@siftd/connect-agent 0.2.48 → 0.2.49
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/orchestrator.d.ts +1 -0
- package/dist/orchestrator.js +15 -3
- package/package.json +1 -1
package/dist/orchestrator.d.ts
CHANGED
package/dist/orchestrator.js
CHANGED
|
@@ -19,7 +19,7 @@ import { WorkerTools } from './tools/worker.js';
|
|
|
19
19
|
import { CalendarTools } from './tools/calendar.js';
|
|
20
20
|
import { SharedState } from './workers/shared-state.js';
|
|
21
21
|
import { getKnowledgeForPrompt } from './genesis/index.js';
|
|
22
|
-
import { loadHubContext, formatHubContext, logAction, logWorker } from './core/hub.js';
|
|
22
|
+
import { loadHubContext, formatHubContext, logAction, logWorker, getSharedOutputPath } from './core/hub.js';
|
|
23
23
|
import { buildWorkerPrompt } from './prompts/worker-system.js';
|
|
24
24
|
import { LiaTaskQueue } from './core/task-queue.js';
|
|
25
25
|
/**
|
|
@@ -839,6 +839,16 @@ export class MasterOrchestrator {
|
|
|
839
839
|
instructions: `TEAM FILES DIRECTORY: ${teamDir}\nSave any requested files under this directory so they appear in /files (Team Files). Create the directory if needed.`,
|
|
840
840
|
};
|
|
841
841
|
}
|
|
842
|
+
rewriteFilesAlias(task) {
|
|
843
|
+
if (!task.includes('/files'))
|
|
844
|
+
return task;
|
|
845
|
+
const teamDir = this.currentFileScope === 'team' ? this.getTeamFilesDir() : null;
|
|
846
|
+
const targetDir = teamDir || getSharedOutputPath();
|
|
847
|
+
return task.replace(/\/files(\/[^\s"'`)]*)?/gi, (match) => {
|
|
848
|
+
const suffix = match.slice('/files'.length);
|
|
849
|
+
return `${targetDir}${suffix}`;
|
|
850
|
+
});
|
|
851
|
+
}
|
|
842
852
|
getFileScopeSystemNote() {
|
|
843
853
|
if (this.currentFileScope !== 'team')
|
|
844
854
|
return null;
|
|
@@ -2099,7 +2109,8 @@ Unlike lia_plan (internal only), this creates a VISIBLE todo list that appears i
|
|
|
2099
2109
|
case 'spawn_worker': {
|
|
2100
2110
|
const { task } = this.withAttachments(input.task);
|
|
2101
2111
|
const fileScope = this.getFileScopeOverrides();
|
|
2102
|
-
const
|
|
2112
|
+
const normalizedTask = this.rewriteFilesAlias(task);
|
|
2113
|
+
const scopedTask = fileScope.instructions ? `${fileScope.instructions}\n\n${normalizedTask}` : normalizedTask;
|
|
2103
2114
|
result = await this.workerTools.spawnWorker(scopedTask, {
|
|
2104
2115
|
timeout: input.timeout,
|
|
2105
2116
|
priority: input.priority,
|
|
@@ -2123,7 +2134,8 @@ Unlike lia_plan (internal only), this creates a VISIBLE todo list that appears i
|
|
|
2123
2134
|
case 'delegate_to_worker': {
|
|
2124
2135
|
const { task, context } = this.withAttachments(input.task, input.context);
|
|
2125
2136
|
const fileScope = this.getFileScopeOverrides();
|
|
2126
|
-
|
|
2137
|
+
const normalizedTask = this.rewriteFilesAlias(task);
|
|
2138
|
+
result = await this.delegateToWorker(normalizedTask, context, input.working_directory || fileScope.workingDir, fileScope.instructions);
|
|
2127
2139
|
break;
|
|
2128
2140
|
}
|
|
2129
2141
|
case 'remember':
|