Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

Merge branch 'pr-3490' into feat/release-3.56.0-batch

re34e742e0f55
diff --cc v3/@claude-flow/cli/src/mcp-tools/session-tools.ts
index 213288df87,665710a324..abb17e32f2
--- a/v3/@claude-flow/cli/src/mcp-tools/session-tools.ts
+++ b/v3/@claude-flow/cli/src/mcp-tools/session-tools.ts
@@@ -746,26 -771,28 +772,32 @@@ export const sessionTools: MCPTool[] =
const inputPath = String(input.inputPath ?? '');
if (!inputPath) return { error: 'Provide inputPath (a session JSON file) or data (a session record)' };
if (!existsSync(inputPath)) return { error: `File not found: ${inputPath}` };
- try { parsed = JSON.parse(readFileSync(inputPath, 'utf-8')); }
+ try {
+ const bytes = readFileSync(inputPath);
+ const content = bytes[0] === 0x1f && bytes[1] === 0x8b ? gunzipSync(bytes) : bytes;
+ parsed = JSON.parse(content.toString('utf-8'));
+ }
catch (e) { return { error: `Invalid session JSON: ${(e as Error).message}` }; }
}
- if (!isSessionRecordLike(parsed)) {
- return { error: 'Not a session record: expected an object produced by session export' };
- }
+ const validationError = validateImportedSession(parsed);
+ if (validationError) return { error: validationError };
+ const record = parsed as Partial<SessionRecord>;
const newId = `session-${Date.now()}-${randomUUID().slice(0, 8)}`;
- const stats = { tasks: 0, agents: 0, memoryEntries: 0, totalSize: 0, ...(parsed.stats || {}) };
+ const stats = {
+ tasks: Object.keys((record.data?.tasks?.tasks as object) || {}).length,
+ agents: Object.keys((record.data?.agents?.agents as object) || {}).length,
+ memoryEntries: countMemoryEntries(record.data?.memory),
+ totalSize: 0,
+ };
const session: SessionRecord = {
sessionId: newId,
- name: input.name ? String(input.name) : (parsed.name || 'imported-session'),
- description: parsed.description,
+ name: input.name ? String(input.name) : (record.name || 'imported-session'),
+ description: record.description,
savedAt: new Date().toISOString(),
stats,
- data: parsed.data,
+ data: record.data,
};
+ session.stats.totalSize = Buffer.byteLength(JSON.stringify(session), 'utf-8');
saveSession(session);
let activated = false;
if (input.activate === true) {