@neturely/okffs 0.3.0 → 0.5.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.
Files changed (45) hide show
  1. package/.changes/README.md +29 -0
  2. package/CHANGELOG.md +29 -1
  3. package/README.md +104 -232
  4. package/dist/board.d.ts +33 -0
  5. package/dist/board.d.ts.map +1 -0
  6. package/dist/board.js +171 -0
  7. package/dist/board.js.map +1 -0
  8. package/dist/config.d.ts +6 -0
  9. package/dist/config.d.ts.map +1 -1
  10. package/dist/config.js +31 -0
  11. package/dist/config.js.map +1 -1
  12. package/dist/docs.d.ts +6 -0
  13. package/dist/docs.d.ts.map +1 -1
  14. package/dist/docs.js +78 -15
  15. package/dist/docs.js.map +1 -1
  16. package/dist/index.js +19 -4
  17. package/dist/index.js.map +1 -1
  18. package/dist/projects.d.ts +18 -3
  19. package/dist/projects.d.ts.map +1 -1
  20. package/dist/projects.js +169 -18
  21. package/dist/projects.js.map +1 -1
  22. package/dist/tools/create_issue.d.ts +5 -1
  23. package/dist/tools/create_issue.d.ts.map +1 -1
  24. package/dist/tools/create_issue.js +82 -41
  25. package/dist/tools/create_issue.js.map +1 -1
  26. package/dist/tools/create_issues_from_list.d.ts +11 -1
  27. package/dist/tools/create_issues_from_list.d.ts.map +1 -1
  28. package/dist/tools/create_issues_from_list.js +39 -2
  29. package/dist/tools/create_issues_from_list.js.map +1 -1
  30. package/dist/tools/create_pull_request.d.ts +1 -1
  31. package/dist/tools/create_pull_request.d.ts.map +1 -1
  32. package/dist/tools/create_pull_request.js +1 -1
  33. package/dist/tools/create_pull_request.js.map +1 -1
  34. package/dist/tools/list_issues.d.ts +1 -1
  35. package/dist/tools/list_issues.d.ts.map +1 -1
  36. package/dist/tools/list_issues.js +58 -7
  37. package/dist/tools/list_issues.js.map +1 -1
  38. package/dist/tools/plan.d.ts +11 -1
  39. package/dist/tools/plan.d.ts.map +1 -1
  40. package/dist/tools/plan.js +47 -5
  41. package/dist/tools/plan.js.map +1 -1
  42. package/dist/tools/prepare_release.d.ts.map +1 -1
  43. package/dist/tools/prepare_release.js +22 -5
  44. package/dist/tools/prepare_release.js.map +1 -1
  45. package/package.json +1 -1
package/dist/projects.js CHANGED
@@ -8,18 +8,23 @@
8
8
  import { graphqlRequest, owner, repo } from "./github.js";
9
9
  import { config } from "./config.js";
10
10
  // Throw a clear, actionable message when the token can't reach Projects, rather
11
- // than leaking a raw GraphQL FORBIDDEN blob. Permission errors arrive either as
12
- // an HTTP 403 or as a 200 with a FORBIDDEN error in the payload.
11
+ // than leaking a raw GraphQL blob. Permission errors arrive in several shapes:
12
+ // an HTTP 403, a 200 with a FORBIDDEN error, or the common gh-CLI-fallback
13
+ // case — an INSUFFICIENT_SCOPES error because the CLI's OAuth token lacks the
14
+ // `project` scope that Projects v2 requires.
13
15
  async function projectCall(fn) {
14
16
  try {
15
17
  return await fn();
16
18
  }
17
19
  catch (err) {
18
20
  const msg = err instanceof Error ? err.message : String(err);
19
- if (/\b403\b|FORBIDDEN|not accessible/i.test(msg)) {
20
- throw new Error("[okffs] GitHub denied a Projects API call (403 / forbidden). The token needs Projects access: " +
21
+ if (/\b403\b|FORBIDDEN|INSUFFICIENT_SCOPES|not accessible|requires .*\bproject\b/i.test(msg)) {
22
+ throw new Error("[okffs] GitHub denied a Projects API call (insufficient scope / forbidden). " +
23
+ "Projects v2 (GraphQL) needs a token with Projects access: " +
21
24
  'fine-grained PAT → Organization permissions → "Projects: Read and write"; ' +
22
25
  "classic PAT → the `project` scope. " +
26
+ "Note: the GitHub CLI fallback token (used when GITHUB_TOKEN is unset) usually " +
27
+ "lacks `project` scope — grant it with `gh auth refresh -s project,read:project`. " +
23
28
  `Original error: ${msg}`);
24
29
  }
25
30
  throw err;
@@ -50,7 +55,7 @@ async function fetchProjectMetadata() {
50
55
  const data = await projectCall(() => graphqlRequest(`query($project:ID!){
51
56
  node(id:$project){
52
57
  ... on ProjectV2 {
53
- fields(first:50){
58
+ fields(first:100){
54
59
  nodes{
55
60
  ... on ProjectV2SingleSelectField { id name options { id name } }
56
61
  }
@@ -64,8 +69,7 @@ async function fetchProjectMetadata() {
64
69
  const meta = {
65
70
  statusFieldId: null,
66
71
  statusOptions: new Map(),
67
- priorityFieldId: null,
68
- priorityOptions: new Map(),
72
+ singleSelectByName: new Map(),
69
73
  };
70
74
  for (const field of data.node.fields.nodes) {
71
75
  // Non-single-select fields come back as empty objects from the inline
@@ -74,14 +78,11 @@ async function fetchProjectMetadata() {
74
78
  continue;
75
79
  const optionMap = new Map(field.options.map((o) => [o.name, o.id]));
76
80
  const name = field.name.toLowerCase();
81
+ meta.singleSelectByName.set(name, { fieldId: field.id, options: optionMap });
77
82
  if (name === "status") {
78
83
  meta.statusFieldId = field.id;
79
84
  meta.statusOptions = optionMap;
80
85
  }
81
- else if (name === "priority") {
82
- meta.priorityFieldId = field.id;
83
- meta.priorityOptions = optionMap;
84
- }
85
86
  }
86
87
  return meta;
87
88
  }
@@ -105,6 +106,102 @@ export async function setProjectFieldValue(itemId, fieldId, optionId) {
105
106
  }){ projectV2Item{ id } }
106
107
  }`, { project: projectId, item: itemId, field: fieldId, opt: optionId }));
107
108
  }
109
+ // --- Org-level Issue Fields (Phase 5.1, #91) -------------------------------
110
+ // GitHub's newer org-level "Issue Fields" (e.g. Priority, Effort) are NOT the
111
+ // same as a project-native single-select field: their options live under
112
+ // organization.issueFields, and values are written on the *issue* (not the
113
+ // project item) via setIssueFieldValue. On such boards the project single-select
114
+ // field reports empty options, which is the signal to fall back to this path.
115
+ //
116
+ // Access needs a different permission than Projects: a classic PAT with the
117
+ // `admin:org` scope works; fine-grained PATs currently get FORBIDDEN for this
118
+ // preview API. Translate that into an actionable message rather than the
119
+ // Projects-scope one.
120
+ // The org-level Issue Fields API is a GitHub preview and is noticeably flaky —
121
+ // transient 5xx / timeouts / secondary-rate blips are common. Retry those a
122
+ // couple of times with a short backoff (#137). Permission errors (403/FORBIDDEN)
123
+ // are deterministic, so they are translated and thrown immediately, never retried.
124
+ const ORG_FIELD_MAX_ATTEMPTS = 3;
125
+ const ORG_FIELD_RETRY_BASE_MS = 300;
126
+ function isOrgFieldPermissionError(msg) {
127
+ return /\b403\b|FORBIDDEN|not accessible/i.test(msg);
128
+ }
129
+ async function orgFieldCall(fn) {
130
+ let lastErr;
131
+ for (let attempt = 1; attempt <= ORG_FIELD_MAX_ATTEMPTS; attempt++) {
132
+ try {
133
+ return await fn();
134
+ }
135
+ catch (err) {
136
+ const msg = err instanceof Error ? err.message : String(err);
137
+ if (isOrgFieldPermissionError(msg)) {
138
+ throw new Error("[okffs] GitHub denied access to org-level Issue Fields (organization.issueFields). " +
139
+ "This is a separate permission from Projects: a classic PAT with the `admin:org` scope works; " +
140
+ "fine-grained PATs currently return FORBIDDEN for this preview API. Use an org-capable GITHUB_TOKEN " +
141
+ "or set the field manually in the board UI. " +
142
+ `Original error: ${msg}`);
143
+ }
144
+ lastErr = err;
145
+ if (attempt < ORG_FIELD_MAX_ATTEMPTS) {
146
+ console.warn(`[okffs] org Issue Fields API call failed (attempt ${attempt}/${ORG_FIELD_MAX_ATTEMPTS}), retrying: ${msg}`);
147
+ await new Promise((resolve) => setTimeout(resolve, ORG_FIELD_RETRY_BASE_MS * attempt));
148
+ }
149
+ }
150
+ }
151
+ // Normalize to an Error so callers' `err instanceof Error` handling is reliable.
152
+ throw lastErr instanceof Error ? lastErr : new Error(String(lastErr));
153
+ }
154
+ // Per-field-name cache so each org Issue Field (Priority, Effort, …) is fetched
155
+ // at most once per process. On failure the entry is cleared so a later call can
156
+ // retry.
157
+ const orgFieldCache = new Map();
158
+ // Discover an org single-select Issue Field by name (case-insensitive) and its
159
+ // options. Returns null if the owner isn't an org, has no such field, or it
160
+ // isn't a single-select. Throws (via orgFieldCall) on a permission error.
161
+ export function getOrgIssueField(name) {
162
+ const key = name.toLowerCase();
163
+ let cached = orgFieldCache.get(key);
164
+ if (!cached) {
165
+ cached = fetchOrgIssueField(key).catch((err) => {
166
+ orgFieldCache.delete(key);
167
+ throw err;
168
+ });
169
+ orgFieldCache.set(key, cached);
170
+ }
171
+ return cached;
172
+ }
173
+ async function fetchOrgIssueField(nameLower) {
174
+ const data = await orgFieldCall(() => graphqlRequest(`query($org:String!){
175
+ organization(login:$org){
176
+ issueFields(first:100){
177
+ nodes{
178
+ __typename
179
+ ... on IssueFieldSingleSelect { id name options { id name } }
180
+ }
181
+ }
182
+ }
183
+ }`, { org: owner }));
184
+ const nodes = data.organization?.issueFields?.nodes ?? [];
185
+ const match = nodes.find((n) => n.__typename === "IssueFieldSingleSelect" &&
186
+ (n.name ?? "").toLowerCase() === nameLower &&
187
+ n.id &&
188
+ n.options);
189
+ if (!match?.id || !match.options)
190
+ return null;
191
+ return {
192
+ fieldId: match.id,
193
+ options: new Map(match.options.map((o) => [o.name, o.id])),
194
+ };
195
+ }
196
+ // Set an org Issue Field single-select value on an issue (by its node id).
197
+ export async function setIssueFieldSingleSelect(issueNodeId, fieldId, optionId) {
198
+ await orgFieldCall(() => graphqlRequest(`mutation($iss:ID!,$field:ID!,$opt:ID!){
199
+ setIssueFieldValue(input:{
200
+ issueId:$iss,
201
+ issueFields:[{ fieldId:$field, singleSelectOptionId:$opt }]
202
+ }){ issue{ number } }
203
+ }`, { iss: issueNodeId, field: fieldId, opt: optionId }));
204
+ }
108
205
  // Find the project item id for an issue already on the board (null if absent).
109
206
  export async function getProjectItemForIssue(issueNumber) {
110
207
  const projectId = requireProjectId();
@@ -118,9 +215,10 @@ export async function getProjectItemForIssue(issueNumber) {
118
215
  const nodes = data.repository?.issue?.projectItems.nodes ?? [];
119
216
  return nodes.find((n) => n.project.id === projectId)?.id ?? null;
120
217
  }
121
- // Map of issue number → current Status column, for list_issues enrichment.
122
- // Capped at the first 100 board items (matches list_issues' own page size).
123
- export async function getProjectStatusByIssueNumber() {
218
+ // Map of issue number → its board Status + project-native Priority/Effort, for
219
+ // list_issues enrichment. Capped at the first 100 board items (matches
220
+ // list_issues' own page size).
221
+ export async function getProjectFieldsByIssueNumber() {
124
222
  const projectId = requireProjectId();
125
223
  const data = await projectCall(() => graphqlRequest(`query($project:ID!){
126
224
  node(id:$project){
@@ -128,7 +226,13 @@ export async function getProjectStatusByIssueNumber() {
128
226
  items(first:100){
129
227
  nodes{
130
228
  content{ ... on Issue { number } }
131
- fieldValueByName(name:"Status"){
229
+ status:fieldValueByName(name:"Status"){
230
+ ... on ProjectV2ItemFieldSingleSelectValue { name }
231
+ }
232
+ priority:fieldValueByName(name:"Priority"){
233
+ ... on ProjectV2ItemFieldSingleSelectValue { name }
234
+ }
235
+ effort:fieldValueByName(name:"Effort"){
132
236
  ... on ProjectV2ItemFieldSingleSelectValue { name }
133
237
  }
134
238
  }
@@ -139,9 +243,56 @@ export async function getProjectStatusByIssueNumber() {
139
243
  const result = new Map();
140
244
  for (const item of data.node?.items.nodes ?? []) {
141
245
  const number = item.content?.number;
142
- const status = item.fieldValueByName?.name;
143
- if (number != null && status)
144
- result.set(number, status);
246
+ if (number == null)
247
+ continue;
248
+ const fields = {};
249
+ if (item.status?.name)
250
+ fields.status = item.status.name;
251
+ if (item.priority?.name)
252
+ fields.priority = item.priority.name;
253
+ if (item.effort?.name)
254
+ fields.effort = item.effort.name;
255
+ if (fields.status || fields.priority || fields.effort)
256
+ result.set(number, fields);
257
+ }
258
+ return result;
259
+ }
260
+ // Map of issue number → its org-level Issue Field single-select values, keyed by
261
+ // lowercased field name (e.g. "priority" → "High", "effort" → "Medium"). For
262
+ // boards whose Priority/Effort are org Issue Fields (not project-native fields —
263
+ // those aren't readable off the project item). One batched query over open
264
+ // issues. Needs the org-field permission, so callers gate this on
265
+ // OKFFS_CLASSIC_PAT. Throws (via orgFieldCall) on a permission error; list_issues
266
+ // treats that as non-fatal.
267
+ export async function getOrgIssueFieldValuesByNumber() {
268
+ const data = await orgFieldCall(() => graphqlRequest(`query($owner:String!,$repo:String!){
269
+ repository(owner:$owner,name:$repo){
270
+ issues(first:100,states:OPEN){
271
+ nodes{
272
+ number
273
+ issueFieldValues(first:50){
274
+ nodes{
275
+ __typename
276
+ ... on IssueFieldSingleSelectValue {
277
+ name
278
+ field{ ... on IssueFieldSingleSelect { name } }
279
+ }
280
+ }
281
+ }
282
+ }
283
+ }
284
+ }
285
+ }`, { owner, repo }));
286
+ const result = new Map();
287
+ for (const issue of data.repository?.issues.nodes ?? []) {
288
+ const values = new Map();
289
+ for (const v of issue.issueFieldValues.nodes) {
290
+ const fname = v.field?.name;
291
+ if (fname && v.name)
292
+ values.set(fname.toLowerCase(), v.name);
293
+ }
294
+ if (values.size)
295
+ result.set(issue.number, values);
145
296
  }
146
297
  return result;
147
298
  }
@@ -1 +1 @@
1
- {"version":3,"file":"projects.js","sourceRoot":"","sources":["../src/projects.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,2EAA2E;AAC3E,4EAA4E;AAC5E,8DAA8D;AAE9D,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAWrC,gFAAgF;AAChF,gFAAgF;AAChF,iEAAiE;AACjE,KAAK,UAAU,WAAW,CAAI,EAAoB;IAChD,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,EAAE,CAAC;IACpB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,IAAI,mCAAmC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,KAAK,CACb,gGAAgG;gBAC9F,4EAA4E;gBAC5E,qCAAqC;gBACrC,mBAAmB,GAAG,EAAE,CAC3B,CAAC;QACJ,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;A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,CAAC;IACtD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;QACxD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;QACzC,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;YAC7C,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC;YAC5B,IAAI,KAAK,IAAI,CAAC,CAAC,IAAI;gBAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,MAAM,CAAC,IAAI;YAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export declare const name = "create_issue";
3
- export declare const description = "Create a GitHub issue and automatically create a matching branch. Before calling this tool, infer appropriate labels from the issue title and description using GitHub's default labels: bug, documentation, duplicate, enhancement, good first issue, help wanted, invalid, question, wontfix. Pass the inferred labels in the labels parameter unless the user has specified their own. If the user mentions that this issue is blocked by, blocking, or a child of another issue, call link_issues after creating this issue to set the relationship. Returns the issue URL, issue number, and branch name.";
3
+ export declare const description: string;
4
+ export declare function getDescription(): Promise<string>;
4
5
  export declare const inputSchema: z.ZodObject<{
5
6
  title: z.ZodString;
6
7
  description: z.ZodString;
@@ -8,10 +9,12 @@ export declare const inputSchema: z.ZodObject<{
8
9
  labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9
10
  milestone: z.ZodOptional<z.ZodNumber>;
10
11
  priority: z.ZodOptional<z.ZodString>;
12
+ effort: z.ZodOptional<z.ZodString>;
11
13
  }, "strip", z.ZodTypeAny, {
12
14
  title: string;
13
15
  description: string;
14
16
  priority?: string | undefined;
17
+ effort?: string | undefined;
15
18
  assignees?: string[] | undefined;
16
19
  labels?: string[] | undefined;
17
20
  milestone?: number | undefined;
@@ -19,6 +22,7 @@ export declare const inputSchema: z.ZodObject<{
19
22
  title: string;
20
23
  description: string;
21
24
  priority?: string | undefined;
25
+ effort?: string | undefined;
22
26
  assignees?: string[] | undefined;
23
27
  labels?: string[] | undefined;
24
28
  milestone?: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"create_issue.d.ts","sourceRoot":"","sources":["../../src/tools/create_issue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,IAAI,iBAAiB,CAAC;AAEnC,eAAO,MAAM,WAAW,mlBAC0jB,CAAC;AAEnlB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;EAStB,CAAC;AAEH,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;GAuJ/D"}
1
+ {"version":3,"file":"create_issue.d.ts","sourceRoot":"","sources":["../../src/tools/create_issue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,IAAI,iBAAiB,CAAC;AAiCnC,eAAO,MAAM,WAAW,QAA4D,CAAC;AAMrF,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAStD;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;EAYtB,CAAC;AAEH,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;GAmJ/D"}
@@ -2,22 +2,68 @@ import { z } from "zod";
2
2
  import { createIssue, updateIssueBody, getDefaultBranch, getRef, createBranch, buildBranchName, createDraftPullRequest } from "../github.js";
3
3
  import { config } from "../config.js";
4
4
  import { git, currentBranch } from "../git.js";
5
- import { addIssueToProject, getProjectMetadata, setProjectFieldValue } from "../projects.js";
5
+ import { boardAutoAddEnabled, addIssueToBoard, applyInitialStatus, renderBoardLines, getBoardFieldOptions, } from "../board.js";
6
6
  export const name = "create_issue";
7
- export const description = "Create a GitHub issue and automatically create a matching branch. Before calling this tool, infer appropriate labels from the issue title and description using GitHub's default labels: bug, documentation, duplicate, enhancement, good first issue, help wanted, invalid, question, wontfix. Pass the inferred labels in the labels parameter unless the user has specified their own. If the user mentions that this issue is blocked by, blocking, or a child of another issue, call link_issues after creating this issue to set the relationship. Returns the issue URL, issue number, and branch name.";
7
+ const DESCRIPTION_HEAD = "Create a GitHub issue and automatically create a matching branch. Before calling this tool, infer appropriate labels from the issue title and description using GitHub's default labels: bug, documentation, duplicate, enhancement, good first issue, help wanted, invalid, question, wontfix. Pass the inferred labels in the labels parameter unless the user has specified their own.";
8
+ const DESCRIPTION_TAIL = " If the user mentions that this issue is blocked by, blocking, or a child of another issue, call link_issues after creating this issue to set the relationship. Returns the issue URL, issue number, and branch name.";
9
+ // Priority/Effort inference guidance is woven into the tool description so Claude
10
+ // uses its own judgement to triage the issue it's creating (like it already does
11
+ // for labels), falling back to OKFFS_DEFAULT_* only when it can't tell. Toggle per
12
+ // field with OKFFS_INFER_PRIORITY / OKFFS_INFER_EFFORT (default on). When the
13
+ // board's real option names are known they replace the generic scale so Claude
14
+ // infers against the actual options (#133) — e.g. a P0/P1/P2 board.
15
+ function inferenceGuidance(priorityOpts, effortOpts) {
16
+ const bits = [];
17
+ if (config.inferPriority) {
18
+ const scale = priorityOpts?.length ? priorityOpts.join(", ") : "Urgent, High, Medium, Low";
19
+ bits.push(`infer a \`priority\` for the issue from its urgency and impact (board options: ${scale})`);
20
+ }
21
+ if (config.inferEffort) {
22
+ const scale = effortOpts?.length ? effortOpts.join(", ") : "High, Medium, Low";
23
+ bits.push(`infer an \`effort\` from the expected amount of work (board options: ${scale})`);
24
+ }
25
+ if (bits.length === 0)
26
+ return "";
27
+ return (` Also ${bits.join(" and ")}, passing the value(s) in the matching parameter. ` +
28
+ "okffs matches these against the board's actual options and falls back to OKFFS_DEFAULT_PRIORITY / OKFFS_DEFAULT_EFFORT when you omit them — so if you genuinely can't judge, omit the field rather than guessing.");
29
+ }
30
+ // Static description (generic scale) — the safe fallback used before the board is
31
+ // reachable and whenever real options can't be read.
32
+ export const description = DESCRIPTION_HEAD + inferenceGuidance() + DESCRIPTION_TAIL;
33
+ // Dynamic description resolved at tools/list time (index.ts awaits this). When
34
+ // auto-add is on and inference is enabled, inject the board's real Priority/Effort
35
+ // option names so Claude infers against them (#133). Any miss falls back to the
36
+ // static description. Cheap after the first call — board metadata is memoized.
37
+ export async function getDescription() {
38
+ if (!boardAutoAddEnabled())
39
+ return description;
40
+ if (!config.inferPriority && !config.inferEffort)
41
+ return description;
42
+ const [priorityOpts, effortOpts] = await Promise.all([
43
+ config.inferPriority ? getBoardFieldOptions("Priority") : Promise.resolve(null),
44
+ config.inferEffort ? getBoardFieldOptions("Effort") : Promise.resolve(null),
45
+ ]);
46
+ if (!priorityOpts && !effortOpts)
47
+ return description;
48
+ return DESCRIPTION_HEAD + inferenceGuidance(priorityOpts, effortOpts) + DESCRIPTION_TAIL;
49
+ }
8
50
  export const inputSchema = z.object({
9
51
  title: z.string().describe("Issue title"),
10
52
  description: z.string().describe("Issue body / description"),
11
53
  assignees: z.array(z.string()).optional().describe("GitHub usernames to assign"),
12
54
  labels: z.array(z.string()).optional().describe("Labels to apply e.g. bug, feature"),
13
55
  milestone: z.number().int().optional().describe("Milestone number to assign"),
14
- priority: z.string().optional().describe("Optional Project board Priority (e.g. High, Medium, Low) — matched against the board's Priority field options. Only applied when OKFFS_PROJECT_AUTO_ADD=true and the board has a Priority field."),
56
+ priority: z.string().optional().describe("Optional Project board Priority (e.g. Urgent, High, Medium, Low) — matched against the board's Priority options (project-native field, or a GitHub org Issue Field when OKFFS_CLASSIC_PAT is set). Only applied when OKFFS_PROJECT_AUTO_ADD=true and a Priority field exists. If omitted, OKFFS_DEFAULT_PRIORITY is used when set."),
57
+ effort: z.string().optional().describe("Optional Project board Effort (e.g. High, Medium, Low) — matched against the board's Effort options (project-native field, or a GitHub org Issue Field when OKFFS_CLASSIC_PAT is set). Only applied when OKFFS_PROJECT_AUTO_ADD=true and an Effort field exists. If omitted, OKFFS_DEFAULT_EFFORT is used when set."),
15
58
  });
16
59
  export async function handler(input) {
17
60
  const resolvedAssignees = input.assignees ?? config.defaultAssignees;
18
61
  const resolvedLabels = [
19
62
  ...new Set([...(input.labels ?? []), ...config.defaultLabels])
20
63
  ];
64
+ // Fall back to OKFFS_DEFAULT_PRIORITY / OKFFS_DEFAULT_EFFORT when not given.
65
+ const resolvedPriority = input.priority ?? config.defaultPriority;
66
+ const resolvedEffort = input.effort ?? config.defaultEffort;
21
67
  const issue = await createIssue(input.title, input.description, resolvedAssignees, resolvedLabels, input.milestone);
22
68
  const branchName = buildBranchName(issue.number, input.title);
23
69
  const defaultBranch = await getDefaultBranch();
@@ -26,43 +72,19 @@ export async function handler(input) {
26
72
  const updatedBody = `${input.description}\n\n**Branch:** \`${branchName}\``;
27
73
  await updateIssueBody(issue.number, updatedBody);
28
74
  // Add the issue to the configured Project board (fallback for users without
29
- // native board automation). Non-fatal, mirroring the autoPR block below: any
30
- // failure warns with an [okffs] prefix and never blocks issue creation.
31
- let addedToBoard = false;
32
- let priorityApplied = null;
33
- if (config.projectAutoAdd && config.projectEnabled) {
75
+ // native board automation) and set Priority/Effort. Non-fatal, mirroring the
76
+ // autoPR block below: any failure warns with an [okffs] prefix, is surfaced in
77
+ // the response, and never blocks issue creation. Initial Status is applied
78
+ // later (after the draft PR) — see the applyInitialStatus call below.
79
+ let boardAdd = null;
80
+ let boardError = null;
81
+ if (boardAutoAddEnabled()) {
34
82
  try {
35
- const itemId = await addIssueToProject(issue.node_id);
36
- addedToBoard = true;
37
- if (input.priority) {
38
- const meta = await getProjectMetadata();
39
- const optionId = meta.priorityFieldId
40
- ? meta.priorityOptions.get(input.priority)
41
- : undefined;
42
- if (meta.priorityFieldId && optionId) {
43
- await setProjectFieldValue(itemId, meta.priorityFieldId, optionId);
44
- priorityApplied = input.priority;
45
- }
46
- else if (!meta.priorityFieldId) {
47
- console.warn(`[okffs] Priority "${input.priority}" not set: the board has no Priority field.`);
48
- }
49
- else if (meta.priorityOptions.size === 0) {
50
- // Priority field exists but exposes no options via the project API —
51
- // the hallmark of a GitHub org-level Issue Field (options live under
52
- // organization.issueFields, not on the project single-select field).
53
- // Full read/write support is tracked in #91.
54
- console.warn(`[okffs] Priority "${input.priority}" not set: the board's Priority field looks like an ` +
55
- `org-level Issue Field, whose options aren't settable via the project API yet (see #91). ` +
56
- `Set it manually in the board UI for now.`);
57
- }
58
- else {
59
- const opts = [...meta.priorityOptions.keys()].join(", ");
60
- console.warn(`[okffs] Could not set priority "${input.priority}" — no matching option. Board Priority options: ${opts}.`);
61
- }
62
- }
83
+ boardAdd = await addIssueToBoard(issue.node_id, { priority: resolvedPriority, effort: resolvedEffort });
63
84
  }
64
85
  catch (err) {
65
- console.warn("[okffs] Failed to add issue to project board:", err instanceof Error ? err.message : err);
86
+ boardError = err instanceof Error ? err.message : String(err);
87
+ console.warn("[okffs] Failed to add issue to project board:", boardError);
66
88
  }
67
89
  }
68
90
  let draftPRUrl = null;
@@ -98,6 +120,16 @@ export async function handler(input) {
98
120
  console.warn("[okffs] Failed to create draft PR:", err instanceof Error ? err.message : err);
99
121
  }
100
122
  }
123
+ // Pin the board Status to the configured initial column (e.g. Backlog). This
124
+ // runs LAST — after the draft PR is created — on purpose: the PR's `Closes #N`
125
+ // link fires GitHub's "PR linked to issue" workflow, which flips a scaffolded
126
+ // issue to "In Progress". Setting our intended status here lets it win that
127
+ // race so freshly-created issues land where okffs means them to (#103).
128
+ // Non-fatal, like the rest of the board handling.
129
+ let initialStatus = null;
130
+ if (boardAdd) {
131
+ initialStatus = await applyInitialStatus(boardAdd.itemId);
132
+ }
101
133
  const lines = [
102
134
  `Issue #${issue.number} created: ${issue.html_url}`,
103
135
  `Branch: \`${branchName}\``,
@@ -113,14 +145,23 @@ export async function handler(input) {
113
145
  const source = input.labels ? "" : " (default)";
114
146
  lines.push(`Labels: ${resolvedLabels.join(", ")}${source}`);
115
147
  }
116
- if (addedToBoard) {
117
- lines.push(`Board: added to the project${priorityApplied ? ` (priority: ${priorityApplied})` : ""}`);
118
- }
148
+ const addedToBoard = Boolean(boardAdd);
149
+ lines.push(...renderBoardLines({
150
+ addedToBoard,
151
+ boardError,
152
+ requestedPriority: resolvedPriority,
153
+ priority: boardAdd?.priority ?? null,
154
+ requestedEffort: resolvedEffort,
155
+ effort: boardAdd?.effort ?? null,
156
+ requestedStatus: config.projectInitialStatus,
157
+ initialStatus,
158
+ }));
119
159
  lines.push(``, `To start work:`, ` git fetch origin`, ` git checkout ${branchName}`);
120
160
  // Conversational nudge: prompt the host LLM to offer moving the issue into
121
161
  // the "In Progress" column via update_project_status once work begins.
122
162
  if (addedToBoard) {
123
- lines.push(``, `This issue is on the board in its default column. Want me to move it to "In Progress" and start? ` +
163
+ const where = initialStatus?.applied ? `"${initialStatus.applied}"` : "its default column";
164
+ lines.push(``, `This issue is on the board in ${where}. Want me to move it to "In Progress" and start? ` +
124
165
  `(I can call update_project_status for #${issue.number}.)`);
125
166
  }
126
167
  if (config.promptForMetadata && !input.assignees && !input.labels) {
@@ -1 +1 @@
1
- {"version":3,"file":"create_issue.js","sourceRoot":"","sources":["../../src/tools/create_issue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC7I,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,iBAAiB,E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,CAAC;IACvC,KAAK,CAAC,IAAI,CACR,GAAG,gBAAgB,CAAC;QAClB,YAAY;QACZ,UAAU;QACV,iBAAiB,EAAE,gBAAgB;QACnC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,IAAI,IAAI;QACpC,eAAe,EAAE,cAAc;QAC/B,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,IAAI;QAChC,eAAe,EAAE,MAAM,CAAC,oBAAoB;QAC5C,aAAa;KACd,CAAC,CACH,CAAC;IAEF,KAAK,CAAC,IAAI,CACR,EAAE,EACF,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,UAAU,EAAE,CAC/B,CAAC;IAEF,2EAA2E;IAC3E,uEAAuE;IACvE,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,KAAK,GAAG,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,oBAAoB,CAAC;QAC3F,KAAK,CAAC,IAAI,CACR,EAAE,EACF,iCAAiC,KAAK,mDAAmD;YACzF,0CAA0C,KAAK,CAAC,MAAM,IAAI,CAC3D,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC,iBAAiB,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClE,KAAK,CAAC,IAAI,CACR,EAAE,EACF,sDAAsD,EACtD,uCAAuC,EACvC,8BAA8B,EAC9B,8DAA8D,CAC/D,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;KAC7D,CAAC;AACJ,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  export declare const name = "create_issues_from_list";
3
- export declare const description = "Create multiple GitHub issues and matching branches from a list of tasks. Before calling this tool, infer appropriate labels for each task from its title and description using GitHub's default labels: bug, documentation, duplicate, enhancement, good first issue, help wanted, invalid, question, wontfix. Pass inferred labels per task in the labels field unless the user has specified their own. Confirms before creating.";
3
+ export declare const description = "Create multiple GitHub issues and matching branches from a list of tasks. Before calling this tool, infer appropriate labels for each task from its title and description using GitHub's default labels: bug, documentation, duplicate, enhancement, good first issue, help wanted, invalid, question, wontfix. Pass inferred labels per task in the labels field unless the user has specified their own. When the Project board is enabled (OKFFS_PROJECT_AUTO_ADD=true), each issue is added to the board like create_issue does \u2014 infer a per-task priority/effort where you can, falling back to OKFFS_DEFAULT_PRIORITY/EFFORT. Confirms before creating.";
4
4
  export declare const inputSchema: z.ZodObject<{
5
5
  tasks: z.ZodArray<z.ZodObject<{
6
6
  title: z.ZodString;
@@ -8,15 +8,21 @@ export declare const inputSchema: z.ZodObject<{
8
8
  assignees: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9
9
  labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
10
10
  milestone: z.ZodOptional<z.ZodNumber>;
11
+ priority: z.ZodOptional<z.ZodString>;
12
+ effort: z.ZodOptional<z.ZodString>;
11
13
  }, "strip", z.ZodTypeAny, {
12
14
  title: string;
13
15
  description: string;
16
+ priority?: string | undefined;
17
+ effort?: string | undefined;
14
18
  assignees?: string[] | undefined;
15
19
  labels?: string[] | undefined;
16
20
  milestone?: number | undefined;
17
21
  }, {
18
22
  title: string;
19
23
  description: string;
24
+ priority?: string | undefined;
25
+ effort?: string | undefined;
20
26
  assignees?: string[] | undefined;
21
27
  labels?: string[] | undefined;
22
28
  milestone?: number | undefined;
@@ -26,6 +32,8 @@ export declare const inputSchema: z.ZodObject<{
26
32
  tasks: {
27
33
  title: string;
28
34
  description: string;
35
+ priority?: string | undefined;
36
+ effort?: string | undefined;
29
37
  assignees?: string[] | undefined;
30
38
  labels?: string[] | undefined;
31
39
  milestone?: number | undefined;
@@ -35,6 +43,8 @@ export declare const inputSchema: z.ZodObject<{
35
43
  tasks: {
36
44
  title: string;
37
45
  description: string;
46
+ priority?: string | undefined;
47
+ effort?: string | undefined;
38
48
  assignees?: string[] | undefined;
39
49
  labels?: string[] | undefined;
40
50
  milestone?: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"create_issues_from_list.d.ts","sourceRoot":"","sources":["../../src/tools/create_issues_from_list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,IAAI,4BAA4B,CAAC;AAE9C,eAAO,MAAM,WAAW,yaACgZ,CAAC;AAUza,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtB,CAAC;AAEH,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;GAmC/D"}
1
+ {"version":3,"file":"create_issues_from_list.d.ts","sourceRoot":"","sources":["../../src/tools/create_issues_from_list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,IAAI,4BAA4B,CAAC;AAE9C,eAAO,MAAM,WAAW,woBAC0mB,CAAC;AAgBnoB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtB,CAAC;AAEH,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;GAuE/D"}