"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const JobLifecycle_1 = require("./orchestrator/JobLifecycle");
function assert(condition, message) {
    if (!condition)
        throw new Error(message);
}
const store = new JobLifecycle_1.JobLifecycleStore('testws');
const job = store.enqueue('test objective', 'testws');
store.transition(job.jobId, 'testws', 'claimed', 'claimed', 'agent-a');
store.transition(job.jobId, 'testws', 'started', 'started', 'agent-a');
store.transition(job.jobId, 'testws', 'completed', 'done', 'agent-a');
const rec = store.get(job.jobId);
assert(rec?.status === 'completed', 'job should be completed');
assert(store.events(job.jobId).length >= 4, 'job should have lifecycle events');
console.log('TEST_JOB_LIFECYCLE_OK');
