LeoYeAI/agent-master-skills / skills/auto-respawn
auto-respawn
VerifiedYour agent always comes back. Anchor identity and memory on-chain so any new instance can resurrect from just an address — no local state, no single point of failure. Permanent identity and recovery on the Autonomys Network.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 16.4 KB |
| _meta.json | config | 281 B |
| auto-respawn.ts | script | 14.4 KB |
| eslint.config.js | script | 468 B |
| lib/address.ts | script | 2.2 KB |
| lib/balance.ts | script | 1.1 KB |
| lib/cli.ts | script | 1.6 KB |
| lib/evm-balance.ts | script | 925 B |
| lib/evm-transfer.ts | script | 2.4 KB |
| lib/evm.ts | script | 3.4 KB |
| lib/memory-chain.ts | script | 3.5 KB |
| lib/network.ts | script | 1.4 KB |
| lib/remark.ts | script | 1.3 KB |
| lib/transfer.ts | script | 1.7 KB |
| lib/wallet.ts | script | 8.8 KB |
| lib/xdm.ts | script | 3.3 KB |
| package.json | manifest | 647 B |
| references/auto-respawn-commands.md | markdown | 9.6 KB |
| references/autonomys-network.md | markdown | 6.2 KB |
| setup.shexecutable | script | 2.2 KB |
| tests/address.test.ts | script | 3.4 KB |
| tests/balance.test.ts | script | 4.3 KB |
| tests/cli.test.ts | script | 3.5 KB |
| tests/evm-balance.test.ts | script | 3.1 KB |
| tests/evm-transfer.test.ts | script | 5.2 KB |
| tests/evm.test.ts | script | 2.4 KB |
| tests/network.test.ts | script | 1.8 KB |
| tests/wallet-roundtrip.test.ts | script | 6.3 KB |
| tests/wallet.test.ts | script | 1.1 KB |
| tsconfig.json | config | 366 B |
tests/address.test.ts
View on GitHubimport { describe, it, expect } from 'vitest'
import { isConsensusAddress, isEvmAddress, normalizeAddress, normalizeEvmAddress } from '../lib/address.js'
// Known valid addresses for testing
const VALID_EVM = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
const VALID_EVM_LOWER = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045'
// Derived from test mnemonic "test test test test test test test test test test test junk"
const VALID_SU_ADDRESS = 'sufmoyKii8Se1QaUz8wQSN9YBypcNtpi2d6XKPkpCxr3kZC5m'
const VALID_5_ADDRESS = '5GmS1wtCfR4tK5SSgnZbVT4kYw5W8NmxmijcsxCQE6oLW6A8'
describe('isConsensusAddress', () => {
it('accepts valid su... address', () => {
expect(isConsensusAddress(VALID_SU_ADDRESS)).toBe(true)
})
it('accepts valid 5... address', () => {
expect(isConsensusAddress(VALID_5_ADDRESS)).toBe(true)
})
it('rejects EVM addresses', () => {
expect(isConsensusAddress(VALID_EVM)).toBe(false)
})
it('rejects empty string', () => {
expect(isConsensusAddress('')).toBe(false)
})
it('rejects random strings', () => {
expect(isConsensusAddress('hello')).toBe(false)
})
})
describe('isEvmAddress', () => {
it('accepts valid checksummed EVM address', () => {
expect(isEvmAddress(VALID_EVM)).toBe(true)
})
it('accepts valid lowercase EVM address', () => {
expect(isEvmAddress(VALID_EVM_LOWER)).toBe(true)
})
it('rejects addresses without 0x prefix', () => {
// Must require 0x prefix to stay consistent with normalizeEvmAddress
expect(isEvmAddress('d8dA6BF26964aF9D7eEd9e03E53415D37aA96045')).toBe(false)
})
it('rejects too-short addresses', () => {
expect(isEvmAddress('0x1234')).toBe(false)
})
it('rejects empty string', () => {
expect(isEvmAddress('')).toBe(false)
})
it('rejects consensus addresses', () => {
expect(isEvmAddress('su1234567890')).toBe(false)
})
})
describe('normalizeAddress', () => {
it('passes through a valid su... address', () => {
const result = normalizeAddress(VALID_SU_ADDRESS)
expect(result).toBe(VALID_SU_ADDRESS)
})
it('converts a 5... address to su... format', () => {
const result = normalizeAddress(VALID_5_ADDRESS)
expect(result).toMatch(/^su/)
// Both formats represent the same public key, so normalising the 5... address
// should produce the same su... address
expect(result).toBe(VALID_SU_ADDRESS)
})
it('throws on EVM addresses', () => {
expect(() => normalizeAddress(VALID_EVM)).toThrow(/Invalid address prefix/)
})
it('throws on random strings', () => {
expect(() => normalizeAddress('hello')).toThrow(/Invalid address prefix/)
})
it('throws on address with valid prefix but invalid encoding', () => {
expect(() => normalizeAddress('su00000000000000000000')).toThrow(/Could not decode/)
})
})
describe('normalizeEvmAddress', () => {
it('checksums a valid lowercase address', () => {
const result = normalizeEvmAddress(VALID_EVM_LOWER)
expect(result).toBe(VALID_EVM)
})
it('passes through an already-checksummed address', () => {
const result = normalizeEvmAddress(VALID_EVM)
expect(result).toBe(VALID_EVM)
})
it('throws on missing 0x prefix', () => {
expect(() => normalizeEvmAddress('d8dA6BF26964aF9D7eEd9e03E53415D37aA96045'))
.toThrow(/Expected an address starting with 0x/)
})
it('throws on invalid hex', () => {
expect(() => normalizeEvmAddress('0xZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'))
.toThrow(/Not a valid Ethereum address/)
})
})
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Unverified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |