mirror of
https://github.com/saltbo/agent-kanban.git
synced 2026-09-19 09:01:47 +08:00
a2fa54a729
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.
19 lines
555 B
TypeScript
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;
|
|
}
|