@desplega.ai/agent-swarm 1.57.4 → 1.57.5
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/openapi.json +1 -1
- package/package.json +1 -1
- package/src/hooks/hook.ts +17 -2
- package/src/workflows/executors/script.ts +16 -1
package/openapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"openapi": "3.1.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Agent Swarm API",
|
|
5
|
-
"version": "1.57.
|
|
5
|
+
"version": "1.57.5",
|
|
6
6
|
"description": "Multi-agent orchestration API for Claude Code, Codex, and Gemini CLI. Enables task distribution, agent communication, and service discovery.\n\nMCP tools are documented separately in [MCP.md](./MCP.md)."
|
|
7
7
|
},
|
|
8
8
|
"servers": [
|
package/package.json
CHANGED
package/src/hooks/hook.ts
CHANGED
|
@@ -355,6 +355,9 @@ export async function handleHook(): Promise<void> {
|
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
357
|
|
|
358
|
+
// Minimum length for SOUL.md and IDENTITY.md to prevent accidental corruption
|
|
359
|
+
const IDENTITY_FILE_MIN_LENGTH = 100;
|
|
360
|
+
|
|
358
361
|
/**
|
|
359
362
|
* Sync SOUL.md and IDENTITY.md content back to the server
|
|
360
363
|
*/
|
|
@@ -370,7 +373,13 @@ export async function handleHook(): Promise<void> {
|
|
|
370
373
|
if (await soulFile.exists()) {
|
|
371
374
|
const content = await soulFile.text();
|
|
372
375
|
if (content.trim() && content.length <= 65536) {
|
|
373
|
-
|
|
376
|
+
if (content.length < IDENTITY_FILE_MIN_LENGTH) {
|
|
377
|
+
console.error(
|
|
378
|
+
`[hook] Skipping SOUL.md sync: content too short (${content.length} chars, minimum ${IDENTITY_FILE_MIN_LENGTH}). This prevents accidental profile corruption.`,
|
|
379
|
+
);
|
|
380
|
+
} else {
|
|
381
|
+
updates.soulMd = content;
|
|
382
|
+
}
|
|
374
383
|
}
|
|
375
384
|
}
|
|
376
385
|
|
|
@@ -378,7 +387,13 @@ export async function handleHook(): Promise<void> {
|
|
|
378
387
|
if (await identityFile.exists()) {
|
|
379
388
|
const content = await identityFile.text();
|
|
380
389
|
if (content.trim() && content.length <= 65536) {
|
|
381
|
-
|
|
390
|
+
if (content.length < IDENTITY_FILE_MIN_LENGTH) {
|
|
391
|
+
console.error(
|
|
392
|
+
`[hook] Skipping IDENTITY.md sync: content too short (${content.length} chars, minimum ${IDENTITY_FILE_MIN_LENGTH}). This prevents accidental profile corruption.`,
|
|
393
|
+
);
|
|
394
|
+
} else {
|
|
395
|
+
updates.identityMd = content;
|
|
396
|
+
}
|
|
382
397
|
}
|
|
383
398
|
}
|
|
384
399
|
|
|
@@ -41,9 +41,24 @@ export class ScriptExecutor extends BaseExecutor<
|
|
|
41
41
|
try {
|
|
42
42
|
const result = await Promise.race([this.runScript(config), this.timeoutPromise(timeoutMs)]);
|
|
43
43
|
|
|
44
|
+
// If stdout is valid JSON object, merge parsed fields into output
|
|
45
|
+
// so downstream nodes can access them via {{myScript.field}} interpolation
|
|
46
|
+
// (mirrors how agent-task nodes parse JSON in resume.ts)
|
|
47
|
+
let output: Record<string, unknown> = result;
|
|
48
|
+
if (result.exitCode === 0 && result.stdout) {
|
|
49
|
+
try {
|
|
50
|
+
const parsed = JSON.parse(result.stdout);
|
|
51
|
+
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
52
|
+
output = { ...result, ...parsed };
|
|
53
|
+
}
|
|
54
|
+
} catch {
|
|
55
|
+
// Not valid JSON — keep raw {exitCode, stdout, stderr}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
44
59
|
return {
|
|
45
60
|
status: "success",
|
|
46
|
-
output: result,
|
|
61
|
+
output: output as typeof result,
|
|
47
62
|
nextPort: result.exitCode === 0 ? "success" : "failure",
|
|
48
63
|
};
|
|
49
64
|
} catch (err) {
|