Files
saltbo__agent-kanban/server/adapters/d1/tasks/taskRow.ts
jarvis a2fa54a729 feat!: rebuild Agent Kanban for Realmroot Toolbox
Replace the v1 Agent/Machine runtime and CLI architecture with the v2 Resource Server, AMA-backed projections, task lifecycle, session observation, BDD specifications, and a single-package layered codebase.

BREAKING CHANGE: remove the v1 CLI, internal Agent/Machine runtime entities, workspace layout, and legacy runtime coordination APIs.
2026-09-02 00:17:52 -04:00

19 lines
555 B
TypeScript

import { parseJsonFields } from "@server/db";
import type { Task } from "@shared";
type PersistedTaskFields = {
active_claim_id?: string | null;
creation_token?: string | null;
result?: string | null;
transition_token?: string | null;
};
export function mapTaskRow<T extends Task>(row: T & PersistedTaskFields): T {
const task = parseJsonFields(row, ["labels", "input", "metadata"]) as T & PersistedTaskFields;
delete task.active_claim_id;
delete task.creation_token;
delete task.result;
delete task.transition_token;
return task;
}