@siftd/connect-agent 0.2.54 → 0.2.55
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.
- package/dist/agent.js +9 -2
- package/dist/orchestrator.js +10 -2
- package/package.json +1 -1
package/dist/agent.js
CHANGED
|
@@ -415,8 +415,15 @@ export async function runAgent(pollInterval = 2000) {
|
|
|
415
415
|
});
|
|
416
416
|
// Worker results - send to user when workers complete
|
|
417
417
|
orchestrator.setWorkerResultCallback((workerId, result) => {
|
|
418
|
-
|
|
419
|
-
|
|
418
|
+
const trimmed = result.trim();
|
|
419
|
+
const lower = trimmed.toLowerCase();
|
|
420
|
+
const shouldSuppress = !trimmed ||
|
|
421
|
+
trimmed === '(No output)' ||
|
|
422
|
+
lower.startsWith('worker timed out') ||
|
|
423
|
+
lower.startsWith('worker error') ||
|
|
424
|
+
lower.includes('partial output: none');
|
|
425
|
+
console.log(`[WORKER DONE] ${workerId}: ${trimmed.slice(0, 100)}${shouldSuppress ? ' (suppressed)' : ''}`);
|
|
426
|
+
if (!shouldSuppress && wsClient?.connected()) {
|
|
420
427
|
// Send as response with worker ID as message ID
|
|
421
428
|
wsClient.sendResponse(workerId, `**Worker completed:**\n\n${result}`);
|
|
422
429
|
}
|
package/dist/orchestrator.js
CHANGED
|
@@ -736,13 +736,16 @@ export class MasterOrchestrator {
|
|
|
736
736
|
const lower = this.stripTodoSnapshot(message).toLowerCase();
|
|
737
737
|
const target = /(^|\s)\/cal\b|\/calendar\b|\bcalendar\b|\bcal\b|\bschedule\b|\bagenda\b/.test(lower);
|
|
738
738
|
const action = /\b(add|create|schedule|book|move|reschedule|update|change|cancel|delete|remove|set|put|place|remind)\b/.test(lower);
|
|
739
|
+
const dateCue = /\b(today|tomorrow|tonight|next|this\s+(week|month|year)|mon(day)?|tue(sday)?|wed(nesday)?|thu(rsday)?|fri(day)?|sat(urday)?|sun(day)?|\b\d{1,2}(:\d{2})?\s?(am|pm)\b|\b\d{1,2}\/\d{1,2}\b|\b\d{4}-\d{2}-\d{2}\b)\b/.test(lower);
|
|
740
|
+
const eventCue = /\b(meeting|call|appointment|event|reminder|session|class|lecture|review|deadline)\b/.test(lower);
|
|
741
|
+
const implicitTarget = eventCue && dateCue;
|
|
739
742
|
const query = /\b(what|show|list|open|view|see)\b/.test(lower);
|
|
740
|
-
return target && action && !query;
|
|
743
|
+
return (target || implicitTarget) && action && !query;
|
|
741
744
|
}
|
|
742
745
|
hasFileMutation(message) {
|
|
743
746
|
const lower = this.stripTodoSnapshot(message).toLowerCase();
|
|
744
747
|
const target = /(^|\s)\/files\b|\bfiles?\b/.test(lower);
|
|
745
|
-
const action = /\b(create|make|write|save|generate|export|upload|attach|produce|edit|update|modify|delete|remove)\b/.test(lower);
|
|
748
|
+
const action = /\b(create|make|write|save|generate|export|upload|attach|produce|edit|update|modify|delete|remove|add|append|insert|include)\b/.test(lower);
|
|
746
749
|
const query = /\b(what|show|list|open|view|see|browse|find)\b/.test(lower);
|
|
747
750
|
return target && action && !query;
|
|
748
751
|
}
|
|
@@ -2241,6 +2244,11 @@ Unlike lia_plan (internal only), this creates a VISIBLE todo list that appears i
|
|
|
2241
2244
|
try {
|
|
2242
2245
|
const pathValue = String(input.path || '').trim();
|
|
2243
2246
|
const content = String(input.content || '');
|
|
2247
|
+
const allowEmpty = /\b(empty|blank|placeholder)\b/i.test(this.lastUserMessage || '');
|
|
2248
|
+
if (!content.trim() && !allowEmpty) {
|
|
2249
|
+
result = { success: false, output: '', error: 'Refusing to write empty file content.' };
|
|
2250
|
+
break;
|
|
2251
|
+
}
|
|
2244
2252
|
const targetPath = this.resolveFilesWritePath(pathValue);
|
|
2245
2253
|
mkdirSync(dirname(targetPath), { recursive: true });
|
|
2246
2254
|
writeFileSync(targetPath, content, 'utf8');
|