init: vibn-agent-runner — Gemini autonomous agent backend

Made-with: Cursor
This commit is contained in:
2026-02-26 14:50:20 -08:00
commit 8870f2b1e0
2519 changed files with 973799 additions and 0 deletions

43
dist/job-store.js vendored Normal file
View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createJob = createJob;
exports.getJob = getJob;
exports.updateJob = updateJob;
exports.listJobs = listJobs;
const uuid_1 = require("uuid");
// ---------------------------------------------------------------------------
// In-memory store (swap for Redis/DB if scaling horizontally)
// ---------------------------------------------------------------------------
const store = new Map();
function createJob(agent, task, repo) {
const job = {
id: (0, uuid_1.v4)(),
agent,
task,
repo,
status: 'queued',
progress: 'Job queued',
toolCalls: [],
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString()
};
store.set(job.id, job);
return job;
}
function getJob(id) {
return store.get(id);
}
function updateJob(id, updates) {
const job = store.get(id);
if (!job)
return undefined;
const updated = { ...job, ...updates, id, updatedAt: new Date().toISOString() };
store.set(id, updated);
return updated;
}
function listJobs(limit = 50) {
const all = Array.from(store.values());
return all
.sort((a, b) => b.createdAt.localeCompare(a.createdAt))
.slice(0, limit);
}