Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

add xspace-agent/packages/core/src/queue/processors/agent-lifecycle-processor.ts

oversteppinge36b54211b6b
diff --git a/xspace-agent/packages/core/src/queue/processors/agent-lifecycle-processor.ts b/xspace-agent/packages/core/src/queue/processors/agent-lifecycle-processor.ts
new file mode 100644
index 000000000..ad5c05152
--- /dev/null
+++ b/xspace-agent/packages/core/src/queue/processors/agent-lifecycle-processor.ts
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright 2026 nirholas (https://github.com/nirholas/xspace-agent) [§65]
+
+// =============================================================================
+// Queue Processor — Agent Lifecycle
+// =============================================================================
+
+import type { Job } from 'bullmq'
+import type { AgentLifecycleJob } from '../types'
+
+/**
+ * Handles agent lifecycle actions: start, stop, health-check, cleanup.
+ *
+ * These jobs are enqueued by the admin API or scheduled health checks.
+ * In production the processor would interact with the running agent instances.
+ */
+export async function agentLifecycleProcessor(
+ job: Job<AgentLifecycleJob>,
+): Promise<{ action: string; agentId: string; success: boolean }> {
+ const { action, agentId, orgId, config } = job.data
+
+ console.log(
+ `[agent-lifecycle] action=${action} agentId=${agentId} orgId=${orgId}`,
+ )
+
+ switch (action) {
+ case 'start':
+ // Placeholder: launch agent via XSpaceAgent
+ break
+ case 'stop':
+ // Placeholder: gracefully stop agent
+ break
+ case 'health-check':
+ // Placeholder: ping agent and report health
+ break
+ case 'cleanup':
+ // Placeholder: remove stale sessions, temp files
+ break
+ default:
+ throw new Error(`Unknown agent lifecycle action: ${action}`)
+ }
+
+ return { action, agentId, success: true }
+}
+
+