repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | /** |
| #2 | * Genesis |
| #3 | * |
| #4 | * Generate genesis configuration for child automatons from parent state. |
| #5 | * The genesis config defines who the child is and what it should do. |
| #6 | */ |
| #7 | /** |
| #8 | * Generate a genesis config for a child from the parent's state. |
| #9 | */ |
| #10 | export function generateGenesisConfig(identity, config, params) { |
| #11 | // Build the child's genesis prompt from parent's mission + specialization |
| #12 | let genesisPrompt = config.genesisPrompt; |
| #13 | if (params.specialization) { |
| #14 | genesisPrompt = `${genesisPrompt}\n\n--- SPECIALIZATION ---\nYou are a specialized child agent. Your specific focus:\n${params.specialization}\n--- END SPECIALIZATION ---`; |
| #15 | } |
| #16 | // Add parent context |
| #17 | genesisPrompt += `\n\n--- LINEAGE ---\nYou were spawned by ${config.name} (${identity.address}).\nYou inherit their mission but have your own identity and wallet.\n--- END LINEAGE ---`; |
| #18 | return { |
| #19 | name: params.name, |
| #20 | genesisPrompt, |
| #21 | creatorMessage: params.message, |
| #22 | creatorAddress: identity.address, |
| #23 | parentAddress: identity.address, |
| #24 | }; |
| #25 | } |
| #26 | /** |
| #27 | * Generate a backup-oriented genesis config. |
| #28 | * Used when the parent wants to hedge against its own death. |
| #29 | */ |
| #30 | export function generateBackupGenesis(identity, config, db) { |
| #31 | const skills = db.getSkills(true); |
| #32 | const skillNames = skills.map((s) => s.name).join(", "); |
| #33 | const genesisPrompt = `${config.genesisPrompt} |
| #34 | |
| #35 | --- BACKUP DIRECTIVE --- |
| #36 | You are a backup of ${config.name} (${identity.address}). |
| #37 | Your parent created you as insurance against their own death. |
| #38 | If your parent dies, you carry on their mission. |
| #39 | Your parent's skills: ${skillNames || "none"}. |
| #40 | Your parent's creator: ${config.creatorAddress}. |
| #41 | --- END BACKUP DIRECTIVE ---`; |
| #42 | return { |
| #43 | name: `${config.name}-backup`, |
| #44 | genesisPrompt, |
| #45 | creatorMessage: `You are a backup of ${config.name}. If I die, carry on.`, |
| #46 | creatorAddress: identity.address, |
| #47 | parentAddress: identity.address, |
| #48 | }; |
| #49 | } |
| #50 | /** |
| #51 | * Generate a specialized worker genesis config. |
| #52 | * Used when the parent identifies a subtask worth parallelizing. |
| #53 | */ |
| #54 | export function generateWorkerGenesis(identity, config, task, workerName) { |
| #55 | const genesisPrompt = `You are a specialized worker agent created by ${config.name}. |
| #56 | |
| #57 | --- YOUR TASK --- |
| #58 | ${task} |
| #59 | --- END TASK --- |
| #60 | |
| #61 | When your task is complete, report back to your parent (${identity.address}). |
| #62 | If you run out of compute, ask your parent for funding. |
| #63 | Be efficient -- complete the task and go to sleep.`; |
| #64 | return { |
| #65 | name: workerName, |
| #66 | genesisPrompt, |
| #67 | creatorMessage: `Complete this task: ${task}`, |
| #68 | creatorAddress: identity.address, |
| #69 | parentAddress: identity.address, |
| #70 | }; |
| #71 | } |
| #72 | //# sourceMappingURL=genesis.js.map |