@hasna/projects
Version:
High-level project management CLI, MCP server, SDK, and AI SDK agent loop for coding agents
38 lines • 2.44 kB
TypeScript
import type { Database } from "bun:sqlite";
import { type ProjectRelationEdge } from "../lib/project-relations.js";
import { type ProjectRelation, type ProjectRelationMutationRequest, type ProjectRelationMutationResult, type ProjectRelationReadRequest, type ProjectRelationReadResult } from "../types/workspace.js";
/**
* The complete, bounded collection of live relations that name this project on
* EITHER side. One read is the whole two-sided answer: no second "reverse"
* lookup, no per-relation query.
*/
export declare function listProjectRelationHeads(projectId: string, maxItems?: number, db?: Database): ProjectRelation[];
/** The retired versions of this project's relations, newest first. History only. */
export declare function listProjectRelationHistory(projectId: string, maxItems?: number, db?: Database): ProjectRelation[];
export declare function readProjectRelations(input: ProjectRelationReadRequest, db?: Database, startedAt?: number): ProjectRelationReadResult;
/**
* Every live head of a hierarchical kind — the graph the cycle walk runs over.
* `related_to` is deliberately absent: it is not a hierarchy edge.
*/
export declare function listProjectRelationAcyclicEdges(db: Database): ProjectRelationEdge[];
/**
* The guarded project-relation write.
*
* Idempotency, the receipt and the fail-closed outcomes are the package's
* existing guarded-mutation contract, unchanged: the same operation/step
* derives the same receipt and replays to it, a changed request for an
* already-accepted step is a terminal nonacceptance, and a stale
* `expected_revision` is a terminal nonacceptance (`stale_revision`) rather than
* an overwrite.
*
* The one deliberate difference from the resource-link mutation is what an
* accepted write does NOT touch: linking two projects writes no `workspaces`
* column at all, because a relation is not an owner, a machine or a path and
* must never be mistakable for an ownership transfer. `post_revision` therefore
* records the revision the write was preconditioned on, and append integrity
* comes from the checks below instead of from advancing a project row — the
* in-transaction cycle walk, the database's one-head-per-ordered-pair index and
* the append-only history.
*/
export declare function mutateProjectRelation(input: ProjectRelationMutationRequest, db?: Database): ProjectRelationMutationResult;
//# sourceMappingURL=project-relations.d.ts.map