@kya-os/create-xmcpi-app
Version:
Bootstrap XMCP applications with identity features
51 lines (49 loc) ⢠2 kB
JavaScript
import { BlackholeEffect, EffectRunner, createSuccessBox, createWelcomeBanner, createGradientText, createAgentTable } from "@kya-os/cli-effects";
export { BlackholeEffect, EffectRunner, createSuccessBox, createWelcomeBanner, createGradientText };
export async function showBlackholeAnimation(text, options, skipExitPrompt = false) {
const runner = new EffectRunner();
const effect = new BlackholeEffect(options);
await runner.run({
effect: effect,
text,
skipExitPrompt
});
}
// Display the claim URL as the success message
export function createSuccessMessage(claimUrl) {
if (claimUrl) {
// Format the claim URL for display
return `
š Claim Your Agent Identity:
${claimUrl}
Your agent is ready to be claimed!`;
}
// Fallback if no claim URL
return createSuccessBox("XMCP-I INITIALIZED", "Your AI agent now has a verifiable decentralized identity");
}
// Use the package's createWelcomeBanner for banners
export async function createKYAOSBanner() {
return await createWelcomeBanner("XMCP-I");
}
// Wrapper function that maps our field names to the package's expected names
export function createIdentityTable(data) {
// Map field names to match the package's AgentData interface
const agentData = {
name: data.agentName, // Map agentName to name
description: data.description,
did: data.did,
publicKey: undefined, // Not used in our implementation
privateKey: data.privateKey,
agentSlug: undefined, // Not used, profileUrl is provided directly
claimUrl: data.claimUrl,
profileUrl: data.profileUrl
};
// Use the package's createAgentTable
let tableOutput = createAgentTable(agentData);
// Add claim URL below the table if it exists (since package doesn't show it)
if (data.claimUrl) {
tableOutput += "\n\nš Claim URL (clickable):\n" + data.claimUrl;
}
return tableOutput;
}
//# sourceMappingURL=index.js.map