agents-relay 1.0.60 → 1.0.62
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/markers.js +7 -3
- package/package.json +1 -1
package/dist/markers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const JOB_MARKER = 'agents-relay:job:v1';
|
|
2
2
|
export const TASK_MARKER = 'agents-relay:task:v1';
|
|
3
3
|
export const AGENT_MARKER = 'agents-relay:agent:v1';
|
|
4
|
-
export function marker(label, value) { return `<!-- ${label} ${JSON.stringify(value)} -->`; }
|
|
4
|
+
export function marker(label, value) { return `<!-- ${label} ${JSON.stringify(value).replace(/>/g, '\\u003e')} -->`; }
|
|
5
5
|
export function parseMarker(body, label) {
|
|
6
6
|
const escaped = label.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
7
7
|
const startMatch = body.match(new RegExp(`<!--\\s*${escaped}\\s+`));
|
|
@@ -33,7 +33,11 @@ export function renderJobComment(job) {
|
|
|
33
33
|
${objective}`;
|
|
34
34
|
}
|
|
35
35
|
export function renderTaskComment(task) {
|
|
36
|
-
const
|
|
36
|
+
const result = task.result?.summary?.trim() ? `
|
|
37
|
+
|
|
38
|
+
### Result
|
|
39
|
+
|
|
40
|
+
${task.result.summary.trim()}` : '';
|
|
37
41
|
return `${marker(TASK_MARKER, task)}
|
|
38
42
|
## Task: ${task.id}
|
|
39
43
|
|
|
@@ -42,7 +46,7 @@ export function renderTaskComment(task) {
|
|
|
42
46
|
|
|
43
47
|
### Work
|
|
44
48
|
|
|
45
|
-
${
|
|
49
|
+
${task.input}${result}`;
|
|
46
50
|
}
|
|
47
51
|
export function parseJob(body) {
|
|
48
52
|
const job = parseMarker(body, JOB_MARKER);
|