permamind
Version:
An MCP server that provides an immortal memory layer for AI agents and clients
38 lines (37 loc) • 1.31 kB
JavaScript
import { z } from "zod";
import { createProcess } from "../../../process.js";
import { ToolCommand } from "../../core/index.js";
export class CreateProcessCommand extends ToolCommand {
context;
metadata = {
description: "Create a new AO process and return its process ID. This spawns a fresh AO process using the default AOS module configuration, ready for immediate use in decentralized computing workflows.",
name: "createProcess",
openWorldHint: false,
readOnlyHint: false,
title: "Create AO Process",
};
parametersSchema = z.object({
// No parameters required for basic process creation
});
constructor(context) {
super();
this.context = context;
}
async execute(args) {
try {
const processId = await createProcess(this.context.keyPair);
return JSON.stringify({
message: `AO process created successfully: ${processId}`,
processId,
success: true,
});
}
catch (error) {
return JSON.stringify({
error: error instanceof Error ? error.message : "Unknown error",
message: "Failed to create AO process",
success: false,
});
}
}
}