UNPKG

@hasna/projects

Version:

High-level project management CLI, MCP server, SDK, and AI SDK agent loop for coding agents

42 lines • 2.49 kB
/** * Presentation helpers for the Projects TUI. Pure + unit-tested. * * These functions only turn registry values into display text — they never * touch the store seam, the theme, or opentui, so the module stays headless * and deterministic. */ import { type ProjectPriority, type ProjectStage } from "../../lib/project-management.js"; import type { ProjectManagementView, ProjectTransport } from "./types.js"; import type { WorkspaceKind, WorkspaceStatus } from "./types.js"; /** A ProjectManagementView health value as the TUI renders it. */ export type ProjectHealth = ProjectManagementView["health"]; /** Truncate text to `max` columns, appending an ellipsis when it overflows. */ export declare function truncate(text: string, max: number): string; /** * Compact relative time: "5s ago", "2m ago", "3h ago", "3d ago", then the bare * ISO date for anything older. Empty string for null/unparseable input. */ export declare function formatRelativeTime(iso: string | null, now?: number): string; /** * Fixed local wall-clock datetime: "2026-09-08 14:30". Empty string for * null/unparseable input. `now` is accepted for call-site symmetry with * `formatRelativeTime`; the formatting itself is fixed (never relative). */ export declare function formatDateTime(iso: string | null, now?: number): string; /** Humanized project kind: "open-source" -> "Open-source", "remote-only" -> "Remote-only". */ export declare function kindLabel(kind: WorkspaceKind | string | null | undefined): string; /** Stable display text for a project status ("active"/"archived"/"deleted"). */ export declare function statusLabel(status: WorkspaceStatus | string): string; /** Display label for a project stage ("active" -> "Active"); "" when unset. */ export declare function stageLabel(stage?: ProjectStage | string | null): string; /** Display label for a project priority ("high" -> "High"); "" when unset. */ export declare function priorityLabel(priority?: ProjectPriority | string | null): string; /** * Display label for a project's path health: identity for the four known * values; anything unexpected renders as "unknown". Decoration (color/glyphs) * is the theme's job, not this function's. */ export declare function healthLabel(health: ProjectHealth | string): string; /** Display label for the registry transport: "local" for sqlite, "hosted" for /v1. */ export declare function transportLabel(transport: ProjectTransport | string): string; //# sourceMappingURL=format.d.ts.map