@neturely/okffs 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -1
- package/README.md +12 -6
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +37 -0
- package/dist/config.js.map +1 -1
- package/dist/git.d.ts +12 -0
- package/dist/git.d.ts.map +1 -1
- package/dist/git.js +31 -0
- package/dist/git.js.map +1 -1
- package/dist/github.d.ts +56 -0
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +46 -2
- package/dist/github.js.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/issue_types.d.ts +5 -0
- package/dist/issue_types.d.ts.map +1 -0
- package/dist/issue_types.js +65 -0
- package/dist/issue_types.js.map +1 -0
- package/dist/tools/commit_and_update.d.ts +19 -0
- package/dist/tools/commit_and_update.d.ts.map +1 -1
- package/dist/tools/commit_and_update.js +59 -6
- package/dist/tools/commit_and_update.js.map +1 -1
- package/dist/tools/create_issue.d.ts +3 -0
- package/dist/tools/create_issue.d.ts.map +1 -1
- package/dist/tools/create_issue.js +51 -41
- package/dist/tools/create_issue.js.map +1 -1
- package/dist/tools/create_issues_from_list.d.ts +6 -1
- package/dist/tools/create_issues_from_list.d.ts.map +1 -1
- package/dist/tools/create_issues_from_list.js +14 -1
- package/dist/tools/create_issues_from_list.js.map +1 -1
- package/dist/tools/create_pull_request.d.ts +4 -1
- package/dist/tools/create_pull_request.d.ts.map +1 -1
- package/dist/tools/create_pull_request.js +35 -8
- package/dist/tools/create_pull_request.js.map +1 -1
- package/dist/tools/fix_into_base.d.ts +23 -0
- package/dist/tools/fix_into_base.d.ts.map +1 -0
- package/dist/tools/fix_into_base.js +110 -0
- package/dist/tools/fix_into_base.js.map +1 -0
- package/dist/tools/list_issues.d.ts +1 -1
- package/dist/tools/list_issues.d.ts.map +1 -1
- package/dist/tools/list_issues.js +6 -1
- package/dist/tools/list_issues.js.map +1 -1
- package/dist/tools/merge_pull_request.d.ts +20 -0
- package/dist/tools/merge_pull_request.d.ts.map +1 -0
- package/dist/tools/merge_pull_request.js +176 -0
- package/dist/tools/merge_pull_request.js.map +1 -0
- package/dist/tools/plan.d.ts +6 -1
- package/dist/tools/plan.d.ts.map +1 -1
- package/dist/tools/plan.js +16 -1
- package/dist/tools/plan.js.map +1 -1
- package/dist/tools/reply_to_review_comment.d.ts +4 -1
- package/dist/tools/reply_to_review_comment.d.ts.map +1 -1
- package/dist/tools/reply_to_review_comment.js +39 -10
- package/dist/tools/reply_to_review_comment.js.map +1 -1
- package/dist/tools/set_issue_fields.d.ts +3 -0
- package/dist/tools/set_issue_fields.d.ts.map +1 -1
- package/dist/tools/set_issue_fields.js +40 -32
- package/dist/tools/set_issue_fields.js.map +1 -1
- package/dist/tools/update_issue.d.ts +32 -0
- package/dist/tools/update_issue.d.ts.map +1 -0
- package/dist/tools/update_issue.js +46 -0
- package/dist/tools/update_issue.js.map +1 -0
- package/package.json +1 -1
package/dist/tools/plan.js
CHANGED
|
@@ -3,8 +3,9 @@ import { createIssue, updateIssueBody, getDefaultBranch, getRef, createBranch, b
|
|
|
3
3
|
import { config } from "../config.js";
|
|
4
4
|
import { git, currentBranch } from "../git.js";
|
|
5
5
|
import { boardAutoAddEnabled, addIssueToBoard, applyInitialStatus, renderBoardLines, } from "../board.js";
|
|
6
|
+
import { applyIssueType } from "../issue_types.js";
|
|
6
7
|
export const name = "plan";
|
|
7
|
-
export const description = "Plan a piece of work and create all the resulting GitHub issues (with branches, draft PRs when OKFFS_AUTO_PR=true, and board placement when OKFFS_PROJECT_AUTO_ADD=true) in one shot. Given a free-text description of the work, break it down yourself into a structured list of issues — each with a title, description, inferred labels, an inferred priority/effort where you can judge it, and any relationships between them — and pass that breakdown as the tasks array. Infer labels from GitHub's defaults: bug, documentation, duplicate, enhancement, good first issue, help wanted, invalid, question, wontfix. Express dependencies via per-task relationships, referencing other tasks by their 1-based position in the list. Two-step confirmation: call once to preview the plan, then re-call with confirmed: true to create everything.";
|
|
8
|
+
export const description = "Plan a piece of work and create all the resulting GitHub issues (with branches, draft PRs when OKFFS_AUTO_PR=true, and board placement when OKFFS_PROJECT_AUTO_ADD=true) in one shot. Given a free-text description of the work, break it down yourself into a structured list of issues — each with a title, description, inferred labels, an inferred priority/effort where you can judge it, an inferred native GitHub Issue Type (Task/Bug/Feature/… — commonly Epic for the overall effort and Task/Story/Feature/Bug for its children), and any relationships between them — and pass that breakdown as the tasks array. Infer labels from GitHub's defaults: bug, documentation, duplicate, enhancement, good first issue, help wanted, invalid, question, wontfix. Express dependencies via per-task relationships, referencing other tasks by their 1-based position in the list. Two-step confirmation: call once to preview the plan, then re-call with confirmed: true to create everything.";
|
|
8
9
|
const relationshipSchema = z.object({
|
|
9
10
|
type: z
|
|
10
11
|
.enum(["blocked_by", "blocking", "parent"])
|
|
@@ -23,6 +24,7 @@ const taskSchema = z.object({
|
|
|
23
24
|
milestone: z.number().int().optional().describe("Milestone number to assign"),
|
|
24
25
|
priority: z.string().optional().describe("Optional Project board Priority (e.g. Urgent, High, Medium, Low). Only applied when OKFFS_PROJECT_AUTO_ADD=true; falls back to OKFFS_DEFAULT_PRIORITY when omitted."),
|
|
25
26
|
effort: z.string().optional().describe("Optional Project board Effort (e.g. High, Medium, Low). Only applied when OKFFS_PROJECT_AUTO_ADD=true; falls back to OKFFS_DEFAULT_EFFORT when omitted."),
|
|
27
|
+
type: z.string().optional().describe("Optional native GitHub Issue Type (e.g. Task, Bug, Feature, Epic, Story) — matched against the org's enabled Issue Types. Skipped cleanly when unavailable; falls back to OKFFS_DEFAULT_TYPE when omitted."),
|
|
26
28
|
relationships: z
|
|
27
29
|
.array(relationshipSchema)
|
|
28
30
|
.optional()
|
|
@@ -78,11 +80,17 @@ export async function handler(input) {
|
|
|
78
80
|
const resolvedLabels = [...new Set([...(task.labels ?? []), ...config.defaultLabels])];
|
|
79
81
|
const resolvedPriority = task.priority ?? config.defaultPriority;
|
|
80
82
|
const resolvedEffort = task.effort ?? config.defaultEffort;
|
|
83
|
+
const resolvedType = task.type ?? config.defaultType;
|
|
81
84
|
const issue = await createIssue(task.title, task.description, resolvedAssignees, resolvedLabels, task.milestone);
|
|
82
85
|
const branchName = buildBranchName(issue.number, task.title);
|
|
83
86
|
await createBranch(branchName, ref.object.sha);
|
|
84
87
|
const body = `${task.description}\n\n**Branch:** \`${branchName}\``;
|
|
85
88
|
await updateIssueBody(issue.number, body);
|
|
89
|
+
// Native Issue Type — non-fatal per task, surfaced in the result below.
|
|
90
|
+
let typeOutcome = null;
|
|
91
|
+
if (resolvedType) {
|
|
92
|
+
typeOutcome = await applyIssueType(issue.number, resolvedType);
|
|
93
|
+
}
|
|
86
94
|
// Add to the board + set Priority/Effort now; the initial Status is applied
|
|
87
95
|
// in a later pass, after any draft PR, so it wins GitHub's linked-PR
|
|
88
96
|
// "In Progress" promotion (#103). Non-fatal and surfaced per issue (#144).
|
|
@@ -105,9 +113,11 @@ export async function handler(input) {
|
|
|
105
113
|
relationships: task.relationships ?? [],
|
|
106
114
|
resolvedPriority,
|
|
107
115
|
resolvedEffort,
|
|
116
|
+
resolvedType,
|
|
108
117
|
boardAdd,
|
|
109
118
|
boardError,
|
|
110
119
|
initialStatus: null,
|
|
120
|
+
typeOutcome,
|
|
111
121
|
});
|
|
112
122
|
}
|
|
113
123
|
// Second pass: resolve relationship targets (1-based task indices) to issue
|
|
@@ -187,6 +197,11 @@ export async function handler(input) {
|
|
|
187
197
|
initialStatus: entry.initialStatus,
|
|
188
198
|
indent: " ",
|
|
189
199
|
}));
|
|
200
|
+
if (entry.typeOutcome) {
|
|
201
|
+
lines.push("applied" in entry.typeOutcome
|
|
202
|
+
? ` Type: ${entry.typeOutcome.applied}`
|
|
203
|
+
: ` ⚠ Type "${entry.resolvedType}" not set — ${entry.typeOutcome.skipped}`);
|
|
204
|
+
}
|
|
190
205
|
return lines.join("\n");
|
|
191
206
|
});
|
|
192
207
|
return {
|
package/dist/tools/plan.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/tools/plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,eAAe,EACf,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/tools/plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,eAAe,EACf,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,GAIjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC;AAE3B,MAAM,CAAC,MAAM,WAAW,GACtB,08BAA08B,CAAC;AAE78B,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;SAC1C,QAAQ,CACP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,KAAK,CAAC,aAAa;YAClC,MAAM,EAAE,IAAI;SACb,CAAC,CACH,CAAC;QACF,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,KAAK,CAAC,IAAI,CACR,SAAS,IAAI,KAAK,CAAC,WAAW;gBAC5B,CAAC,CAAC,WAAW,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE;gBACxC,CAAC,CAAC,aAAa,KAAK,CAAC,YAAY,eAAe,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,CAC9E,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAe;gBACrB,IAAI,EAAE,WAAW,OAAO,CAAC,MAAM,+BAA+B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;aACrF;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const name = "reply_to_review_comment";
|
|
3
|
-
export declare const description
|
|
3
|
+
export declare const description: string;
|
|
4
4
|
export declare const inputSchema: z.ZodObject<{
|
|
5
5
|
pr_number: z.ZodNumber;
|
|
6
6
|
comment_id: z.ZodNumber;
|
|
7
7
|
body: z.ZodString;
|
|
8
|
+
resolve: z.ZodOptional<z.ZodBoolean>;
|
|
8
9
|
}, "strip", z.ZodTypeAny, {
|
|
9
10
|
body: string;
|
|
10
11
|
pr_number: number;
|
|
11
12
|
comment_id: number;
|
|
13
|
+
resolve?: boolean | undefined;
|
|
12
14
|
}, {
|
|
13
15
|
body: string;
|
|
14
16
|
pr_number: number;
|
|
15
17
|
comment_id: number;
|
|
18
|
+
resolve?: boolean | undefined;
|
|
16
19
|
}>;
|
|
17
20
|
export declare function handler(input: z.infer<typeof inputSchema>): Promise<{
|
|
18
21
|
content: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reply_to_review_comment.d.ts","sourceRoot":"","sources":["../../src/tools/reply_to_review_comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"reply_to_review_comment.d.ts","sourceRoot":"","sources":["../../src/tools/reply_to_review_comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,IAAI,4BAA4B,CAAC;AAE9C,eAAO,MAAM,WAAW,QAE0jB,CAAC;AAEnlB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EActB,CAAC;AAEH,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;GAmC/D"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { replyToReviewComment } from "../github.js";
|
|
2
|
+
import { replyToReviewComment, getPullRequestReview, resolveReviewThread } from "../github.js";
|
|
3
|
+
import { config } from "../config.js";
|
|
3
4
|
export const name = "reply_to_review_comment";
|
|
4
|
-
export const description = "Reply to an inline PR review comment thread. Pass the pull request number, the comment id (from list_pr_review_comments), and the reply body. Use after addressing a review comment to record what was changed (e.g. reference the fix commit)."
|
|
5
|
+
export const description = "Reply to an inline PR review comment thread. Pass the pull request number, the comment id (from list_pr_review_comments), and the reply body. Use after addressing a review comment to record what was changed (e.g. reference the fix commit). " +
|
|
6
|
+
"IMPORTANT: a reply does NOT resolve the thread — the thread stays open until you resolve it. The full loop is list_pr_review_comments → reply_to_review_comment → resolve_review_thread; even when OKFFS_RESOLVE_THREADS=true, resolving is a separate, explicit act (this tool leaves the thread open unless you ask it to resolve). To reply and resolve an addressed thread in one call, pass resolve: true (still gated by OKFFS_RESOLVE_THREADS). Prefer this tool over raw `gh api .../replies`, which skips the resolve path and silently leaves threads unresolved despite OKFFS_RESOLVE_THREADS=true.";
|
|
5
7
|
export const inputSchema = z.object({
|
|
6
8
|
pr_number: z.number().int().positive().describe("The pull request number"),
|
|
7
9
|
comment_id: z
|
|
@@ -10,16 +12,43 @@ export const inputSchema = z.object({
|
|
|
10
12
|
.positive()
|
|
11
13
|
.describe("The review comment id to reply to (from list_pr_review_comments)"),
|
|
12
14
|
body: z.string().describe("Reply body"),
|
|
15
|
+
resolve: z
|
|
16
|
+
.boolean()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("When true, also resolve this comment's thread after replying (reply + resolve in one call). Honours the OKFFS_RESOLVE_THREADS gate: when that env var isn't 'true', the reply is still posted but the thread is left open and the response says so. Use ONLY when the reply signals the thread is addressed — not when the reply asks a question or pushes back, which should stay open."),
|
|
13
19
|
});
|
|
14
20
|
export async function handler(input) {
|
|
15
21
|
const reply = await replyToReviewComment(input.pr_number, input.comment_id, input.body);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const lines = [
|
|
23
|
+
`Replied to comment #${input.comment_id} on PR #${input.pr_number}: ${reply.html_url}`,
|
|
24
|
+
];
|
|
25
|
+
if (input.resolve) {
|
|
26
|
+
if (!config.resolveThreads) {
|
|
27
|
+
lines.push("Not resolving the thread — OKFFS_RESOLVE_THREADS is not enabled, so the reply is posted but the thread is left open for you to resolve on GitHub. Set OKFFS_RESOLVE_THREADS=true to allow reply+resolve in one call.");
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
try {
|
|
31
|
+
// The reply endpoint works off a comment id; resolving needs the thread
|
|
32
|
+
// node id, so map comment → thread via the PR's review threads.
|
|
33
|
+
const { threads } = await getPullRequestReview(input.pr_number);
|
|
34
|
+
const thread = threads.find((t) => t.comments.some((c) => c.id === input.comment_id));
|
|
35
|
+
if (!thread) {
|
|
36
|
+
lines.push(`Could not find the thread for comment #${input.comment_id} to resolve — the reply was posted; resolve it manually if needed.`);
|
|
37
|
+
}
|
|
38
|
+
else if (thread.isResolved) {
|
|
39
|
+
lines.push(`Thread ${thread.id} was already resolved.`);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
await resolveReviewThread(thread.id);
|
|
43
|
+
lines.push(`Resolved thread ${thread.id}.`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
48
|
+
lines.push(`Reply posted, but resolving the thread failed: ${msg}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return { content: [{ type: "text", text: lines.join("\n") }] };
|
|
24
53
|
}
|
|
25
54
|
//# sourceMappingURL=reply_to_review_comment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reply_to_review_comment.js","sourceRoot":"","sources":["../../src/tools/reply_to_review_comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"reply_to_review_comment.js","sourceRoot":"","sources":["../../src/tools/reply_to_review_comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,CAAC,MAAM,IAAI,GAAG,yBAAyB,CAAC;AAE9C,MAAM,CAAC,MAAM,WAAW,GACtB,kPAAkP;IAClP,glBAAglB,CAAC;AAEnlB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAA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AC;qBAAM,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;oBAC7B,KAAK,CAAC,IAAI,CAAC,UAAU,MAAM,CAAC,EAAE,wBAAwB,CAAC,CAAC;gBAC1D,CAAC;qBAAM,CAAC;oBACN,MAAM,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBACrC,KAAK,CAAC,IAAI,CAAC,mBAAmB,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;gBAC9C,CAAC;YACH,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAC7D,KAAK,CAAC,IAAI,CAAC,kDAAkD,GAAG,EAAE,CAAC,CAAC;YACtE,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AAC1E,CAAC"}
|
|
@@ -5,12 +5,15 @@ export declare const inputSchema: z.ZodObject<{
|
|
|
5
5
|
issue_number: z.ZodNumber;
|
|
6
6
|
priority: z.ZodOptional<z.ZodString>;
|
|
7
7
|
effort: z.ZodOptional<z.ZodString>;
|
|
8
|
+
type: z.ZodOptional<z.ZodString>;
|
|
8
9
|
}, "strip", z.ZodTypeAny, {
|
|
9
10
|
issue_number: number;
|
|
11
|
+
type?: string | undefined;
|
|
10
12
|
priority?: string | undefined;
|
|
11
13
|
effort?: string | undefined;
|
|
12
14
|
}, {
|
|
13
15
|
issue_number: number;
|
|
16
|
+
type?: string | undefined;
|
|
14
17
|
priority?: string | undefined;
|
|
15
18
|
effort?: string | undefined;
|
|
16
19
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set_issue_fields.d.ts","sourceRoot":"","sources":["../../src/tools/set_issue_fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"set_issue_fields.d.ts","sourceRoot":"","sources":["../../src/tools/set_issue_fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,IAAI,qBAAqB,CAAC;AAEvC,eAAO,MAAM,WAAW,QAKyG,CAAC;AAElI,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EAKtB,CAAC;AASH,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;GAiC/D"}
|
|
@@ -2,47 +2,55 @@ import { z } from "zod";
|
|
|
2
2
|
import { getIssue } from "../github.js";
|
|
3
3
|
import { config } from "../config.js";
|
|
4
4
|
import { addIssueToBoard } from "../board.js";
|
|
5
|
+
import { applyIssueType } from "../issue_types.js";
|
|
5
6
|
export const name = "set_issue_fields";
|
|
6
|
-
export const description = "Set
|
|
7
|
-
"Use this to set
|
|
8
|
-
"
|
|
9
|
-
"
|
|
7
|
+
export const description = "Set enumerated fields on an EXISTING issue: the GitHub Projects v2 board Priority and/or Effort, and/or the native GitHub Issue Type (Task/Bug/Feature/…). " +
|
|
8
|
+
"Use this to set these on issues that already exist — create_issue only sets them at creation time. " +
|
|
9
|
+
"Priority/Effort handle both project-native single-select fields and org-level Issue Fields (the latter needs OKFFS_CLASSIC_PAT + a classic admin:org PAT) and require OKFFS_PROJECT_ENABLED. " +
|
|
10
|
+
"Type is a native GitHub Issue Type (org-level; skipped cleanly on user repos / when unavailable) and works independently of the board. " +
|
|
11
|
+
"To move an issue's Status column, use update_project_status; to edit title/assignees/labels/milestone/body, use update_issue.";
|
|
10
12
|
export const inputSchema = z.object({
|
|
11
13
|
issue_number: z.number().int().positive().describe("The issue number to set fields on"),
|
|
12
|
-
priority: z.string().optional().describe("Board Priority to set (e.g. Urgent, High, Medium, Low) — matched against the board's Priority options"),
|
|
13
|
-
effort: z.string().optional().describe("Board Effort to set (e.g. High, Medium, Low) — matched against the board's Effort options"),
|
|
14
|
+
priority: z.string().optional().describe("Board Priority to set (e.g. Urgent, High, Medium, Low) — matched against the board's Priority options. Requires OKFFS_PROJECT_ENABLED."),
|
|
15
|
+
effort: z.string().optional().describe("Board Effort to set (e.g. High, Medium, Low) — matched against the board's Effort options. Requires OKFFS_PROJECT_ENABLED."),
|
|
16
|
+
type: z.string().optional().describe("Native GitHub Issue Type to set (e.g. Task, Bug, Feature, Epic, Story) — matched against the org's enabled Issue Types. Independent of the board."),
|
|
14
17
|
});
|
|
15
18
|
const text = (t) => ({ content: [{ type: "text", text: t }] });
|
|
19
|
+
const renderOutcome = (label, requested, outcome) => "applied" in outcome
|
|
20
|
+
? `${label} → ${outcome.applied}`
|
|
21
|
+
: `⚠ ${label} "${requested}" not set — ${outcome.skipped}`;
|
|
16
22
|
export async function handler(input) {
|
|
17
|
-
if (!
|
|
18
|
-
return text("
|
|
19
|
-
}
|
|
20
|
-
if (!input.priority && !input.effort) {
|
|
21
|
-
return text("Nothing to set — pass a priority and/or an effort. (For the Status column, use update_project_status.)");
|
|
22
|
-
}
|
|
23
|
-
const issue = await getIssue(input.issue_number);
|
|
24
|
-
let result;
|
|
25
|
-
try {
|
|
26
|
-
// addIssueToBoard adds the issue to the board (idempotent — returns the
|
|
27
|
-
// existing item if already present) and sets Priority/Effort via the shared,
|
|
28
|
-
// org-Issue-Field-aware path. Reused so existing issues get identical handling
|
|
29
|
-
// and surfacing to create_issue.
|
|
30
|
-
result = await addIssueToBoard(issue.node_id, { priority: input.priority, effort: input.effort });
|
|
31
|
-
}
|
|
32
|
-
catch (err) {
|
|
33
|
-
return text(`[okffs] Failed to update board fields on #${input.issue_number}: ${err instanceof Error ? err.message : String(err)}`);
|
|
23
|
+
if (!input.priority && !input.effort && !input.type) {
|
|
24
|
+
return text("Nothing to set — pass a priority, effort, and/or type. (Status column → update_project_status; title/assignees/labels/milestone/body → update_issue.)");
|
|
34
25
|
}
|
|
35
26
|
const lines = [];
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
// Board fields (Priority/Effort) — gated on the Projects integration.
|
|
28
|
+
if (input.priority || input.effort) {
|
|
29
|
+
if (!config.projectEnabled) {
|
|
30
|
+
lines.push("⚠ Priority/Effort not set — OKFFS_PROJECT_ENABLED is not set, so board field updates are disabled.");
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const issue = await getIssue(input.issue_number);
|
|
34
|
+
try {
|
|
35
|
+
// addIssueToBoard adds the issue to the board (idempotent) and sets
|
|
36
|
+
// Priority/Effort via the shared, org-Issue-Field-aware path — identical
|
|
37
|
+
// handling and surfacing to create_issue.
|
|
38
|
+
const result = await addIssueToBoard(issue.node_id, { priority: input.priority, effort: input.effort });
|
|
39
|
+
if (result.priority)
|
|
40
|
+
lines.push(renderOutcome("Priority", input.priority, result.priority));
|
|
41
|
+
if (result.effort)
|
|
42
|
+
lines.push(renderOutcome("Effort", input.effort, result.effort));
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
lines.push(`⚠ Failed to update board fields: ${err instanceof Error ? err.message : String(err)}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
40
48
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
// Native Issue Type — org-level, independent of the board. Non-fatal.
|
|
50
|
+
if (input.type) {
|
|
51
|
+
const outcome = await applyIssueType(input.issue_number, input.type);
|
|
52
|
+
lines.push(renderOutcome("Type", input.type, outcome));
|
|
45
53
|
}
|
|
46
|
-
return text(`Issue #${input.issue_number}
|
|
54
|
+
return text(`Issue #${input.issue_number} fields:\n${lines.map((l) => ` ${l}`).join("\n")}`);
|
|
47
55
|
}
|
|
48
56
|
//# sourceMappingURL=set_issue_fields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set_issue_fields.js","sourceRoot":"","sources":["../../src/tools/set_issue_fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"set_issue_fields.js","sourceRoot":"","sources":["../../src/tools/set_issue_fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,eAAe,EAA0B,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAEvC,MAAM,CAAC,MAAM,WAAW,GACtB,6JAA6J;IAC7J,qGAAqG;IACrG,+LAA+L;IAC/L,yIAAyI;IACzI,+HAA+H,CAAC;AAElI,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IACvF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wIAAwI,CAAC;IAClL,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4HAA4H,CAAC;IACpK,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mJAAmJ,CAAC;CAC1L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AAC,aAAa,CAAC,UAAU,EAAE,KAAK,CAAC,QAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAC7F,IAAI,MAAM,CAAC,MAAM;oBAAE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YACvF,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,KAAK,CAAC,IAAI,CAAC,oCAAoC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACrG,CAAC;QACH,CAAC;IACH,CAAC;IAED,sEAAsE;IACtE,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACrE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,IAAI,CAAC,UAAU,KAAK,CAAC,YAAY,aAAa,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChG,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const name = "update_issue";
|
|
3
|
+
export declare const description: string;
|
|
4
|
+
export declare const inputSchema: z.ZodObject<{
|
|
5
|
+
issue_number: z.ZodNumber;
|
|
6
|
+
title: z.ZodOptional<z.ZodString>;
|
|
7
|
+
body: z.ZodOptional<z.ZodString>;
|
|
8
|
+
assignees: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
9
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
10
|
+
milestone: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
issue_number: number;
|
|
13
|
+
title?: string | undefined;
|
|
14
|
+
body?: string | undefined;
|
|
15
|
+
assignees?: string[] | undefined;
|
|
16
|
+
labels?: string[] | undefined;
|
|
17
|
+
milestone?: number | null | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
issue_number: number;
|
|
20
|
+
title?: string | undefined;
|
|
21
|
+
body?: string | undefined;
|
|
22
|
+
assignees?: string[] | undefined;
|
|
23
|
+
labels?: string[] | undefined;
|
|
24
|
+
milestone?: number | null | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function handler(input: z.infer<typeof inputSchema>): Promise<{
|
|
27
|
+
content: {
|
|
28
|
+
type: "text";
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=update_issue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update_issue.d.ts","sourceRoot":"","sources":["../../src/tools/update_issue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,IAAI,iBAAiB,CAAC;AAEnC,eAAO,MAAM,WAAW,QAQ0C,CAAC;AAEnE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;EAOtB,CAAC;AAIH,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;GA+B/D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { updateIssue } from "../github.js";
|
|
3
|
+
export const name = "update_issue";
|
|
4
|
+
export const description = "Mutate the core fields of an EXISTING GitHub issue — title, assignees, labels, milestone, and/or body. " +
|
|
5
|
+
"create_issue only sets these at creation time; this is how you change them afterward (e.g. rename an issue, " +
|
|
6
|
+
"add or change an assignee) without dropping to raw `gh issue edit`. Authenticates with okffs's configured token " +
|
|
7
|
+
"(GITHUB_TOKEN, or the gh CLI fallback when it's unset) and applies okffs conventions. Pass only the fields you " +
|
|
8
|
+
"want to change — omitted fields are left untouched. NOTE: labels and assignees REPLACE the whole set (they do " +
|
|
9
|
+
"not merge with the current values), so pass the complete desired list; an empty array [] clears them, and " +
|
|
10
|
+
"milestone: null clears the milestone. For board Priority/Effort use set_issue_fields, and for the board Status " +
|
|
11
|
+
"column use update_project_status — those are not issue fields.";
|
|
12
|
+
export const inputSchema = z.object({
|
|
13
|
+
issue_number: z.number().int().positive().describe("The issue number to update"),
|
|
14
|
+
title: z.string().optional().describe("New issue title"),
|
|
15
|
+
body: z.string().optional().describe("New issue body. Replaces the existing body — pass the full content, not a fragment."),
|
|
16
|
+
assignees: z.array(z.string()).optional().describe("GitHub usernames to assign. REPLACES the current assignees (not merged); [] clears them."),
|
|
17
|
+
labels: z.array(z.string()).optional().describe("Labels to apply. REPLACES the current labels (not merged); [] clears them."),
|
|
18
|
+
milestone: z.number().int().positive().nullable().optional().describe("Milestone number to assign, or null to clear the milestone."),
|
|
19
|
+
});
|
|
20
|
+
const text = (t) => ({ content: [{ type: "text", text: t }] });
|
|
21
|
+
export async function handler(input) {
|
|
22
|
+
const { issue_number, ...fields } = input;
|
|
23
|
+
// Require at least one field to change — mirrors set_issue_fields' guard so a
|
|
24
|
+
// no-op call gives an actionable message instead of a silent PATCH.
|
|
25
|
+
const provided = ["title", "body", "assignees", "labels", "milestone"].filter((k) => fields[k] !== undefined);
|
|
26
|
+
if (provided.length === 0) {
|
|
27
|
+
return text("Nothing to update — pass at least one of: title, body, assignees, labels, milestone. " +
|
|
28
|
+
"(For board Priority/Effort use set_issue_fields; for the Status column use update_project_status.)");
|
|
29
|
+
}
|
|
30
|
+
let updated;
|
|
31
|
+
try {
|
|
32
|
+
updated = await updateIssue(issue_number, fields);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
return text(`[okffs] Failed to update issue #${issue_number}: ${err instanceof Error ? err.message : String(err)}`);
|
|
36
|
+
}
|
|
37
|
+
const lines = provided.map((k) => {
|
|
38
|
+
const v = fields[k];
|
|
39
|
+
const shown = Array.isArray(v)
|
|
40
|
+
? (v.length ? v.join(", ") : "(cleared)")
|
|
41
|
+
: v === null ? "(cleared)" : String(v);
|
|
42
|
+
return ` ${k} → ${shown}`;
|
|
43
|
+
});
|
|
44
|
+
return text(`Issue #${issue_number} updated:\n${lines.join("\n")}\n${updated.html_url}`);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=update_issue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update_issue.js","sourceRoot":"","sources":["../../src/tools/update_issue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,IAAI,GAAG,cAAc,CAAC;AAEnC,MAAM,CAAC,MAAM,WAAW,GACtB,yGAAyG;IACzG,8GAA8G;IAC9G,kHAAkH;IAClH,iHAAiH;IACjH,gHAAgH;IAChH,4GAA4G;IAC5G,iHAAiH;IACjH,gEAAgE,CAAC;AAEnE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAChF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACxD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qFAAqF,CAAC;IAC3H,SAAS,EAAE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AAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACtH,CAAC;IAED,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAC/B,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACpB,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAC5B,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;YACzC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACzC,OAAO,KAAK,CAAC,MAAM,KAAK,EAAE,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,UAAU,YAAY,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC3F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neturely/okffs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"mcpName": "io.github.neturely/okffs",
|
|
5
5
|
"description": "MCP server that connects Claude Code to GitHub — create and manage issues and branches without leaving your editor.",
|
|
6
6
|
"type": "module",
|