27 lines
760 B
TypeScript
27 lines
760 B
TypeScript
import { type } from "arktype";
|
|
import type { ToolContext } from "./server.ts";
|
|
import { execute, tool } from "./shared.ts";
|
|
|
|
export const GetIssueEvents = type({
|
|
issue_number: type.number.describe("The issue number to get events for"),
|
|
});
|
|
|
|
export function GetIssueEventsTool(ctx: ToolContext) {
|
|
return tool({
|
|
name: "get_issue_events",
|
|
description:
|
|
"Get timeline events for a Gitea issue that aren't reflected in the current state.",
|
|
parameters: GetIssueEvents,
|
|
execute: execute(async ({ issue_number }) => {
|
|
ctx.toolState.issueNumber = issue_number;
|
|
|
|
// Gitea's timeline API differs from GitHub's; return empty for now.
|
|
return {
|
|
issue_number,
|
|
events: [],
|
|
count: 0,
|
|
};
|
|
}),
|
|
});
|
|
}
|