Download agents/agent-spawner.js from Snapkitty/apple-ii-universal-machine: direct link, hf CLI and curl.
- Browser
- Download file 3.14 kB
-
https://huggingface.co/Snapkitty/apple-ii-universal-machine/resolve/main/agents/agent-spawner.js
- Command line
-
hf download hf://Snapkitty/apple-ii-universal-machine/agents/agent-spawner.js
-
curl -L -o agent-spawner.js https://huggingface.co/Snapkitty/apple-ii-universal-machine/resolve/main/agents/agent-spawner.js
3.14 kB
| var AgentSpawner = { | |
| roles: { | |
| 'researcher': { tools: ['search', 'summarize', 'cite'], permissions: ['read', 'audit'], memory: 'session' }, | |
| 'auditor': { tools: ['verify', 'seal', 'log'], permissions: ['read', 'audit'], memory: 'persistent' }, | |
| 'builder': { tools: ['create', 'edit', 'compile'], permissions: ['read', 'write'], memory: 'session' }, | |
| 'debater': { tools: ['propose', 'challenge', 'synthesize'], permissions: ['read', 'audit'], memory: 'session' }, | |
| 'archivist': { tools: ['store', 'index', 'retrieve'], permissions: ['read', 'write'], memory: 'persistent' }, | |
| 'sentinel': { tools: ['monitor', 'alert', 'block'], permissions: ['read', 'audit'], memory: 'persistent' }, | |
| 'explorer': { tools: ['scan', 'map', 'discover'], permissions: ['read'], memory: 'session' }, | |
| 'translator': { tools: ['decode', 'encode', 'transform'], permissions: ['read', 'write'], memory: 'session' } | |
| }, | |
| spawn: async function(name, role) { | |
| role = (role || 'researcher').toLowerCase(); | |
| var profile = this.roles[role] || this.roles['researcher']; | |
| var agent = { | |
| id: 'agent_' + Date.now().toString(36), | |
| name: name, | |
| role: role, | |
| tools: profile.tools, | |
| permissions: profile.permissions, | |
| memoryScope: profile.memory, | |
| createdAt: new Date().toISOString(), | |
| mode: RuntimeRegistry.current, | |
| lastRun: null, | |
| runCount: 0, | |
| seal: null | |
| }; | |
| var s = await Seal.createSeal({ type: 'AGENT_SPAWN', name: name, role: role }); | |
| agent.seal = s.hash; | |
| AgentRegistry.save(agent); | |
| return agent; | |
| }, | |
| renderProfile: function(agent) { | |
| return [ | |
| 'ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ', | |
| 'β AGENT PROFILE β', | |
| 'β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£', | |
| 'β ID: ' + agent.id.padEnd(43) + 'β', | |
| 'β NAME: ' + agent.name.padEnd(43) + 'β', | |
| 'β ROLE: ' + agent.role.padEnd(43) + 'β', | |
| 'β TOOLS: ' + agent.tools.join(', ').substring(0, 43).padEnd(43) + 'β', | |
| 'β PERMISSIONS: ' + agent.permissions.join(', ').padEnd(43) + 'β', | |
| 'β MEMORY: ' + agent.memoryScope.padEnd(43) + 'β', | |
| 'β MODE: ' + agent.mode.padEnd(43) + 'β', | |
| 'β RUNS: ' + String(agent.runCount).padEnd(43) + 'β', | |
| 'β CREATED: ' + agent.createdAt.substring(0, 19).padEnd(43) + 'β', | |
| 'β SEAL: ' + (agent.seal || 'none').substring(0, 43).padEnd(43) + 'β', | |
| 'ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ' | |
| ].join('\n'); | |
| } | |
| }; | |