Skip to content
Open
13 changes: 13 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"test": "bun test"
},
"dependencies": {
"@vercel/blob": "^2.4.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.576.0",
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/boards/[boardId]/activity/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function GET(request: NextRequest, { params }: Params) {
const limitRaw = url.searchParams.get("limit");
const limit = limitRaw ? Number.parseInt(limitRaw, 10) : undefined;

const storage = getStorage();
const storage = await getStorage();
const events = await storage.listActivity(boardId, {
limit: Number.isFinite(limit) ? limit : undefined,
initiativeId: url.searchParams.get("initiativeId") || undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function POST(request: NextRequest, { params }: Params) {
} catch {
// empty body is fine
}
const storage = getStorage();
const storage = await getStorage();
const agent = await storage.heartbeatAgent(boardId, agentId, message);
if (!agent) {
return NextResponse.json({ ok: false, error: { code: "NOT_FOUND", message: "Agent not found" } }, { status: 404 });
Expand Down
6 changes: 3 additions & 3 deletions src/app/api/boards/[boardId]/agents/[agentId]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Params = { params: Promise<{ boardId: string; agentId: string }> };
export async function GET(_request: NextRequest, { params }: Params) {
try {
const { boardId, agentId } = await params;
const storage = getStorage();
const storage = await getStorage();
const agent = await storage.getAgent(boardId, agentId);
if (!agent) {
return NextResponse.json({ ok: false, error: { code: "NOT_FOUND", message: "Agent not found" } }, { status: 404 });
Expand Down Expand Up @@ -36,7 +36,7 @@ export async function PATCH(request: NextRequest, { params }: Params) {
if ("currentInitiativeId" in body) updates.currentInitiativeId = body.currentInitiativeId;
if ("metadata" in body) updates.metadata = body.metadata;

const storage = getStorage();
const storage = await getStorage();
const agent = await storage.updateAgent(boardId, agentId, updates);
if (!agent) {
return NextResponse.json({ ok: false, error: { code: "NOT_FOUND", message: "Agent not found" } }, { status: 404 });
Expand All @@ -52,7 +52,7 @@ export async function PATCH(request: NextRequest, { params }: Params) {
export async function DELETE(_request: NextRequest, { params }: Params) {
try {
const { boardId, agentId } = await params;
const storage = getStorage();
const storage = await getStorage();
const agent = await storage.getAgent(boardId, agentId);
const deleted = await storage.deleteAgent(boardId, agentId);
if (!deleted) {
Expand Down
4 changes: 2 additions & 2 deletions src/app/api/boards/[boardId]/agents/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export async function POST(request: NextRequest, { params }: Params) {
);
}

const storage = getStorage();
const storage = await getStorage();
const board = await storage.getBoard(boardId);
if (!board) {
return NextResponse.json({ ok: false, error: { code: "NOT_FOUND", message: "Board not found" } }, { status: 404 });
Expand Down Expand Up @@ -310,7 +310,7 @@ export async function POST(request: NextRequest, { params }: Params) {
export async function GET(_request: NextRequest, { params }: Params) {
try {
const { boardId } = await params;
const storage = getStorage();
const storage = await getStorage();
const agents = await storage.listAgents(boardId);
return NextResponse.json({ ok: true, data: agents });
} catch (err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Params = { params: Promise<{ boardId: string; initiativeId: string; planId:
export async function GET(_request: NextRequest, { params }: Params) {
try {
const { boardId, initiativeId, planId } = await params;
const storage = getStorage();
const storage = await getStorage();
const plan = await storage.getPlan(boardId, initiativeId, planId);

if (!plan) {
Expand Down Expand Up @@ -39,7 +39,7 @@ export async function PATCH(request: NextRequest, { params }: Params) {
if ("ownerAgentId" in body) updates.ownerAgentId = body.ownerAgentId;
if ("tags" in body) updates.tags = body.tags;

const storage = getStorage();
const storage = await getStorage();
const plan = await storage.updatePlan(boardId, initiativeId, planId, updates);

if (!plan) {
Expand All @@ -60,7 +60,7 @@ export async function PATCH(request: NextRequest, { params }: Params) {
export async function DELETE(_request: NextRequest, { params }: Params) {
try {
const { boardId, initiativeId, planId } = await params;
const storage = getStorage();
const storage = await getStorage();
const plan = await storage.getPlan(boardId, initiativeId, planId);
const deleted = await storage.deletePlan(boardId, initiativeId, planId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type Params = {
export async function GET(_request: NextRequest, { params }: Params) {
try {
const { boardId, initiativeId, planId, stepId } = await params;
const storage = getStorage();
const storage = await getStorage();
const step = await storage.getPlanStep(boardId, initiativeId, planId, stepId);

if (!step) {
Expand Down Expand Up @@ -41,7 +41,7 @@ export async function PATCH(request: NextRequest, { params }: Params) {
if ("assigneeAgentId" in body) updates.assigneeAgentId = body.assigneeAgentId;
if ("order" in body) updates.order = body.order;

const storage = getStorage();
const storage = await getStorage();
const step = await storage.updatePlanStep(boardId, initiativeId, planId, stepId, updates);

if (!step) {
Expand All @@ -62,7 +62,7 @@ export async function PATCH(request: NextRequest, { params }: Params) {
export async function DELETE(_request: NextRequest, { params }: Params) {
try {
const { boardId, initiativeId, planId, stepId } = await params;
const storage = getStorage();
const storage = await getStorage();
const step = await storage.getPlanStep(boardId, initiativeId, planId, stepId);
const deleted = await storage.deletePlanStep(boardId, initiativeId, planId, stepId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function POST(request: NextRequest, { params }: Params) {
);
}

const storage = getStorage();
const storage = await getStorage();
const plan = await storage.getPlan(boardId, initiativeId, planId);
if (!plan) {
return NextResponse.json(
Expand Down Expand Up @@ -48,7 +48,7 @@ export async function POST(request: NextRequest, { params }: Params) {
export async function GET(_request: NextRequest, { params }: Params) {
try {
const { boardId, initiativeId, planId } = await params;
const storage = getStorage();
const storage = await getStorage();
const steps = await storage.listPlanSteps(boardId, initiativeId, planId);
return NextResponse.json({ ok: true, data: steps });
} catch (err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function POST(request: NextRequest, { params }: Params) {
);
}

const storage = getStorage();
const storage = await getStorage();
const initiative = await storage.getInitiative(boardId, initiativeId);
if (!initiative) {
return NextResponse.json(
Expand Down Expand Up @@ -48,7 +48,7 @@ export async function POST(request: NextRequest, { params }: Params) {
export async function GET(_request: NextRequest, { params }: Params) {
try {
const { boardId, initiativeId } = await params;
const storage = getStorage();
const storage = await getStorage();
const plans = await storage.listPlans(boardId, initiativeId);
return NextResponse.json({ ok: true, data: plans });
} catch (err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Params = { params: Promise<{ boardId: string; initiativeId: string }> };
export async function GET(_request: NextRequest, { params }: Params) {
try {
const { boardId, initiativeId } = await params;
const storage = getStorage();
const storage = await getStorage();
const initiative = await storage.getInitiative(boardId, initiativeId);

if (!initiative) {
Expand Down Expand Up @@ -39,7 +39,7 @@ export async function PATCH(request: NextRequest, { params }: Params) {
if ("kind" in body) updates.kind = body.kind;
if ("assigneeAgentIds" in body) updates.assigneeAgentIds = body.assigneeAgentIds;

const storage = getStorage();
const storage = await getStorage();
const initiative = await storage.updateInitiative(boardId, initiativeId, updates);

if (!initiative) {
Expand All @@ -62,7 +62,7 @@ export async function PATCH(request: NextRequest, { params }: Params) {
export async function DELETE(_request: NextRequest, { params }: Params) {
try {
const { boardId, initiativeId } = await params;
const storage = getStorage();
const storage = await getStorage();
const initiative = await storage.getInitiative(boardId, initiativeId);
const deleted = await storage.deleteInitiative(boardId, initiativeId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Params = { params: Promise<{ boardId: string; initiativeId: string; taskId:
export async function GET(_request: NextRequest, { params }: Params) {
try {
const { boardId, initiativeId, taskId } = await params;
const storage = getStorage();
const storage = await getStorage();
const task = await storage.getTask(boardId, initiativeId, taskId);

if (!task) {
Expand Down Expand Up @@ -39,7 +39,7 @@ export async function PATCH(request: NextRequest, { params }: Params) {
{ status: 400 },
);
}
const storage = getStorage();
const storage = await getStorage();
const actor = await storage.getAgent(boardId, actorAgentId);
if (!actor) {
return NextResponse.json(
Expand Down Expand Up @@ -96,7 +96,7 @@ export async function DELETE(_request: NextRequest, { params }: Params) {
}

const { boardId, initiativeId, taskId } = await params;
const storage = getStorage();
const storage = await getStorage();
const actor = await storage.getAgent(boardId, actorAgentId);
if (!actor) {
return NextResponse.json(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function POST(request: NextRequest, { params }: Params) {
);
}

const storage = getStorage();
const storage = await getStorage();
const actor = await storage.getAgent(boardId, actorAgentId);
if (!actor) {
return NextResponse.json(
Expand Down Expand Up @@ -68,7 +68,7 @@ export async function GET(request: NextRequest, { params }: Params) {
const { boardId, initiativeId } = await params;
const url = new URL(request.url);

const storage = getStorage();
const storage = await getStorage();
const tasks = await storage.listTasks(boardId, initiativeId, {
status: url.searchParams.get("status") || undefined,
assignee: url.searchParams.get("assignee") || undefined,
Expand Down
4 changes: 2 additions & 2 deletions src/app/api/boards/[boardId]/initiatives/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function POST(request: NextRequest, { params }: Params) {
);
}

const storage = getStorage();
const storage = await getStorage();
const board = await storage.getBoard(boardId);
if (!board) {
return NextResponse.json(
Expand Down Expand Up @@ -50,7 +50,7 @@ export async function POST(request: NextRequest, { params }: Params) {
export async function GET(_request: NextRequest, { params }: Params) {
try {
const { boardId } = await params;
const storage = getStorage();
const storage = await getStorage();
const initiatives = await storage.listInitiatives(boardId);
return NextResponse.json({ ok: true, data: initiatives });
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/boards/[boardId]/install/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export async function GET(request: NextRequest, { params }: Params) {
const agentName = url.searchParams.get("name") || agentType + "-agent";
const baseUrl = url.searchParams.get("url") || `${url.protocol}//${url.host}`;

const storage = getStorage();
const storage = await getStorage();
const board = await storage.getBoard(boardId);
if (!board) {
return NextResponse.json(
Expand Down
6 changes: 3 additions & 3 deletions src/app/api/boards/[boardId]/projects/[projectId]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Params = { params: Promise<{ boardId: string; projectId: string }> };
export async function GET(_request: NextRequest, { params }: Params) {
try {
const { boardId, projectId } = await params;
const storage = getStorage();
const storage = await getStorage();
const project = await storage.getProject(boardId, projectId);
if (!project) {
return NextResponse.json({ ok: false, error: { code: "NOT_FOUND", message: "Project not found" } }, { status: 404 });
Expand All @@ -34,7 +34,7 @@ export async function PATCH(request: NextRequest, { params }: Params) {
if ("kind" in body) updates.kind = body.kind;
if ("assigneeAgentIds" in body) updates.assigneeAgentIds = body.assigneeAgentIds;

const storage = getStorage();
const storage = await getStorage();
const project = await storage.updateProject(boardId, projectId, updates);
if (!project) {
return NextResponse.json({ ok: false, error: { code: "NOT_FOUND", message: "Project not found" } }, { status: 404 });
Expand All @@ -51,7 +51,7 @@ export async function PATCH(request: NextRequest, { params }: Params) {
export async function DELETE(_request: NextRequest, { params }: Params) {
try {
const { boardId, projectId } = await params;
const storage = getStorage();
const storage = await getStorage();
const project = await storage.getProject(boardId, projectId);
const deleted = await storage.deleteProject(boardId, projectId);
if (!deleted) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Params = { params: Promise<{ boardId: string; projectId: string; taskId: st
export async function GET(_request: NextRequest, { params }: Params) {
try {
const { boardId, projectId, taskId } = await params;
const storage = getStorage();
const storage = await getStorage();
const task = await storage.getTask(boardId, projectId, taskId);
if (!task) {
return NextResponse.json({ ok: false, error: { code: "NOT_FOUND", message: "Task not found" } }, { status: 404 });
Expand All @@ -34,7 +34,7 @@ export async function PATCH(request: NextRequest, { params }: Params) {
{ status: 400 },
);
}
const storage = getStorage();
const storage = await getStorage();
const actor = await storage.getAgent(boardId, actorAgentId);
if (!actor) {
return NextResponse.json(
Expand Down Expand Up @@ -86,7 +86,7 @@ export async function DELETE(_request: NextRequest, { params }: Params) {
}

const { boardId, projectId, taskId } = await params;
const storage = getStorage();
const storage = await getStorage();
const actor = await storage.getAgent(boardId, actorAgentId);
if (!actor) {
return NextResponse.json(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function POST(request: NextRequest, { params }: Params) {
if (!actorAgentId) {
return NextResponse.json({ ok: false, error: { code: "MISSING_ACTOR", message: "actorAgentId is required" } }, { status: 400 });
}
const storage = getStorage();
const storage = await getStorage();
const actor = await storage.getAgent(boardId, actorAgentId);
if (!actor) {
return NextResponse.json(
Expand Down Expand Up @@ -59,7 +59,7 @@ export async function GET(request: NextRequest, { params }: Params) {
assignee: url.searchParams.get("assignee") || undefined,
tag: url.searchParams.get("tag") || undefined,
};
const storage = getStorage();
const storage = await getStorage();
const tasks = await storage.listTasks(boardId, projectId, filters);
return NextResponse.json({ ok: true, data: tasks });
} catch (err) {
Expand Down
Loading