@neturely/okffs 0.5.2 → 0.7.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 (60) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/README.md +48 -12
  3. package/dist/config.d.ts +9 -0
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js +56 -0
  6. package/dist/config.js.map +1 -1
  7. package/dist/git.d.ts +12 -0
  8. package/dist/git.d.ts.map +1 -1
  9. package/dist/git.js +31 -0
  10. package/dist/git.js.map +1 -1
  11. package/dist/github.d.ts +59 -1
  12. package/dist/github.d.ts.map +1 -1
  13. package/dist/github.js +62 -5
  14. package/dist/github.js.map +1 -1
  15. package/dist/index.js +18 -6
  16. package/dist/index.js.map +1 -1
  17. package/dist/issue_types.d.ts +5 -0
  18. package/dist/issue_types.d.ts.map +1 -0
  19. package/dist/issue_types.js +65 -0
  20. package/dist/issue_types.js.map +1 -0
  21. package/dist/prompts/address_pr_review.d.ts.map +1 -1
  22. package/dist/prompts/address_pr_review.js +6 -4
  23. package/dist/prompts/address_pr_review.js.map +1 -1
  24. package/dist/tools/create_issue.d.ts +3 -0
  25. package/dist/tools/create_issue.d.ts.map +1 -1
  26. package/dist/tools/create_issue.js +51 -41
  27. package/dist/tools/create_issue.js.map +1 -1
  28. package/dist/tools/create_issues_from_list.d.ts +6 -1
  29. package/dist/tools/create_issues_from_list.d.ts.map +1 -1
  30. package/dist/tools/create_issues_from_list.js +14 -1
  31. package/dist/tools/create_issues_from_list.js.map +1 -1
  32. package/dist/tools/create_pull_request.d.ts +4 -4
  33. package/dist/tools/create_pull_request.d.ts.map +1 -1
  34. package/dist/tools/create_pull_request.js +48 -27
  35. package/dist/tools/create_pull_request.js.map +1 -1
  36. package/dist/tools/list_issues.d.ts +1 -1
  37. package/dist/tools/list_issues.d.ts.map +1 -1
  38. package/dist/tools/list_issues.js +6 -1
  39. package/dist/tools/list_issues.js.map +1 -1
  40. package/dist/tools/merge_pull_request.d.ts +17 -0
  41. package/dist/tools/merge_pull_request.d.ts.map +1 -0
  42. package/dist/tools/merge_pull_request.js +142 -0
  43. package/dist/tools/merge_pull_request.js.map +1 -0
  44. package/dist/tools/plan.d.ts +6 -1
  45. package/dist/tools/plan.d.ts.map +1 -1
  46. package/dist/tools/plan.js +16 -1
  47. package/dist/tools/plan.js.map +1 -1
  48. package/dist/tools/promote_branch.d.ts +23 -0
  49. package/dist/tools/promote_branch.d.ts.map +1 -0
  50. package/dist/tools/promote_branch.js +152 -0
  51. package/dist/tools/promote_branch.js.map +1 -0
  52. package/dist/tools/set_issue_fields.d.ts +3 -0
  53. package/dist/tools/set_issue_fields.d.ts.map +1 -1
  54. package/dist/tools/set_issue_fields.js +40 -32
  55. package/dist/tools/set_issue_fields.js.map +1 -1
  56. package/dist/tools/update_issue.d.ts +32 -0
  57. package/dist/tools/update_issue.d.ts.map +1 -0
  58. package/dist/tools/update_issue.js +46 -0
  59. package/dist/tools/update_issue.js.map +1 -0
  60. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -23,9 +23,12 @@ import * as resolveReviewThread from "./tools/resolve_review_thread.js";
23
23
  import * as prepareRelease from "./tools/prepare_release.js";
24
24
  import * as updateProjectStatus from "./tools/update_project_status.js";
25
25
  import * as setIssueFields from "./tools/set_issue_fields.js";
26
+ import * as updateIssue from "./tools/update_issue.js";
27
+ import * as promoteBranch from "./tools/promote_branch.js";
28
+ import * as mergePullRequest from "./tools/merge_pull_request.js";
26
29
  import * as addressPrReview from "./prompts/address_pr_review.js";
27
30
  import * as updateGuidance from "./prompts/update_guidance.js";
28
- const tools = [createIssue, listIssues, closeIssue, deleteIssue, deleteBranch, getIssue, commentIssue, createIssuesFromList, plan, linkIssues, createPullRequest, commitAndUpdate, listPrReviewComments, replyToReviewComment, resolveReviewThread, prepareRelease, updateProjectStatus, setIssueFields];
31
+ const tools = [createIssue, listIssues, closeIssue, deleteIssue, deleteBranch, getIssue, commentIssue, createIssuesFromList, plan, linkIssues, createPullRequest, commitAndUpdate, listPrReviewComments, replyToReviewComment, resolveReviewThread, prepareRelease, updateProjectStatus, setIssueFields, updateIssue, promoteBranch, mergePullRequest];
29
32
  const prompts = [addressPrReview, updateGuidance];
30
33
  // Read the package version so the server reports the real version (dist/index.js
31
34
  // lives one level below package.json in both dev and the published package).
@@ -36,16 +39,25 @@ const version = JSON.parse(readFileSync(new URL("../package.json", import.meta.u
36
39
  // agent sees — this is how new tools/behaviour get adopted instead of the agent
37
40
  // defaulting to raw git/gh (#169). Keep it tight: it's always-on context. This is
38
41
  // the machine-visible counterpart to the human-facing README/CLAUDE.md guidance.
39
- const SERVER_INSTRUCTIONS = `okffs owns the GitHub issue → branch → PR → merge → close workflow (plus, when enabled, a GitHub Projects v2 board and releases). Prefer okffs tools for these actions over raw git/gh/GraphQL: okffs authenticates with GITHUB_TOKEN (use a classic PAT here if org-level Issue Fields are involved) before falling back to the gh CLI, and honours its OKFFS_* env toggles — so hand-rolling git/gh often uses the wrong token or skips okffs conventions.
42
+ const SERVER_INSTRUCTIONS = `okffs owns the GitHub issue → branch → PR → merge → close workflow (plus, when enabled, a GitHub Projects v2 board and releases).
43
+
44
+ ALWAYS reach for an okffs tool before raw git/gh/GraphQL when one covers the action — this is a correctness rule, not a style preference:
45
+ - Identity/permissions: okffs authenticates with the configured GITHUB_TOKEN (a PAT scoped for this repo, incl. Projects / org Issue Fields when set). Raw gh/git uses whatever ambient CLI token is signed in — often the wrong identity or missing the Projects/org scopes, so it fails or acts as the wrong user.
46
+ - Conventions: okffs applies branch naming ({issue}-{slug}), the **Branch:** issue link, Closes #N, board placement, changelog fragments, and the OKFFS_PROTECTED_BRANCH invariant. Hand-rolled gh/git silently skips all of that.
47
+ Fall back to raw git/gh ONLY when no okffs tool fits the action.
40
48
 
41
49
  Common action → tool:
42
- - Start work: create_issue (also creates the linked branch and writes the **Branch:** line that create_pull_request/commit_and_update rely on). Many at once: create_issues_from_list or plan.
43
- - Progress: commit_and_update (stage + commit + push + issue comment). Open/finalize a PR: create_pull_request (always adds Closes #N).
50
+ - Start work: create_issue (creates the issue, the linked branch, and the **Branch:** line that create_pull_request/commit_and_update rely on). Many at once: create_issues_from_list or plan.
51
+ - Progress: commit_and_update (stage + commit + push + issue comment) prefer over raw git commit/push.
52
+ - Open/finalize an issue's PR (into the base branch): create_pull_request (always adds Closes #N).
53
+ - Promotion/release gate — a base→protected PR with no issue, e.g. develop→main: promote_branch (issue-less; adds the PR to the board; NEVER use raw \`gh pr create\` for this).
54
+ - Edit an existing issue's core fields (title, assignees, labels, milestone, body): update_issue — prefer over raw \`gh issue edit\`. (Board Priority/Effort is set_issue_fields; Status column is update_project_status — those aren't issue fields.)
44
55
  - Board: create_issue sets an inferred priority/effort at creation; set them on an EXISTING issue with set_issue_fields; move columns with update_project_status (Backlog/Ready/In Progress/Review — Done is GitHub's own automation).
45
56
  - PR review: list_pr_review_comments → fix → reply_to_review_comment → resolve_review_thread (honours OKFFS_RESOLVE_THREADS); or the /okffs:address_pr_review prompt.
46
- - Release: prepare_release (it does NOT tag or publish).
57
+ - Release prep: prepare_release (bumps version + rolls the changelog; does NOT tag or publish).
58
+ - Land an issue PR into the BASE branch (e.g. develop): merge_pull_request — the one okffs action that merges. Opt-in (OKFFS_AUTO_MERGE_BASE=true) and heavily gated; it verifies checks/threads itself and NEVER touches OKFFS_PROTECTED_BRANCH. Off by default → it just declines.
47
59
 
48
- Rules: never merge, tag, or publish into OKFFS_PROTECTED_BRANCH autonomously — hand back to the user for sign-off. Destructive tools (delete_issue, delete_branch) require confirmed: true (call once to preview, again to act).`;
60
+ Rules: never merge, tag, or publish into OKFFS_PROTECTED_BRANCH autonomously — okffs may OPEN a PR into it (promote_branch), but the merge/tag are yours to hand back for. merge_pull_request only ever lands PRs into the base tier, never the protected branch. Destructive tools (delete_issue, delete_branch) require confirmed: true (call once to preview, again to act).`;
49
61
  const server = new Server({ name: "okffs", version }, { capabilities: { tools: {}, prompts: {} }, instructions: SERVER_INSTRUCTIONS });
50
62
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
51
63
  // A tool may export an async getDescription() to compute its description at
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,YAAY,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,oBAAoB,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,iBAAiB,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,eAAe,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,oBAAoB,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,oBAAoB,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,mBAAmB,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAC7D,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7D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/D,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { BoardFieldOutcome } from "./board.js";
2
+ export declare function issueTypesEnabled(): boolean;
3
+ export declare function getIssueTypeNames(): Promise<string[] | null>;
4
+ export declare function applyIssueType(issueNumber: number, type: string): Promise<BoardFieldOutcome>;
5
+ //# sourceMappingURL=issue_types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issue_types.d.ts","sourceRoot":"","sources":["../src/issue_types.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAUpD,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAID,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAWlE;AAKD,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAuBlG"}
@@ -0,0 +1,65 @@
1
+ // Native GitHub Issue Types (Task/Bug/Feature/Epic/Story) support, mirroring the
2
+ // board Priority/Effort machinery in board.ts: read the org's available type
3
+ // names (memoized, injected into create_issue's inference guidance), and set a
4
+ // type on an issue with validated, NON-FATAL handling — any miss (user-owned
5
+ // repo with no org types, missing token scope, unknown name) is returned as
6
+ // { skipped } and surfaced in the tool response, never blocking issue creation.
7
+ //
8
+ // Issue Types are ORG-LEVEL: /orgs/{org}/issue-types 404s on a user-owned repo
9
+ // and needs an org-capable token. That org-vs-user capability split is the same
10
+ // one tracked in #199 — handled here inline (fetch, catch, memoize null) so this
11
+ // feature degrades cleanly wherever types aren't available.
12
+ import { getOrgIssueTypes, setIssueType } from "./github.js";
13
+ import { config } from "./config.js";
14
+ // Memoize the enabled type names across the process. `undefined` = not yet
15
+ // fetched; a settled entry of `{ value: string[] | null }` caches BOTH the
16
+ // success list and the "unavailable" (null) result, so a user-owned repo pays
17
+ // the 404 at most once.
18
+ let cached;
19
+ // Whether okffs should attempt Issue Type inference/setting at all. Independent
20
+ // of the Projects board — types are native GitHub, not a board field.
21
+ export function issueTypesEnabled() {
22
+ return config.inferType || Boolean(config.defaultType);
23
+ }
24
+ // The org's enabled Issue Type names, or null when unavailable (user repo, no
25
+ // org types defined, or the token can't read them). Cheap after the first call.
26
+ export async function getIssueTypeNames() {
27
+ if (cached)
28
+ return cached.value;
29
+ try {
30
+ const types = await getOrgIssueTypes();
31
+ const names = types.filter((t) => t.is_enabled).map((t) => t.name);
32
+ cached = { value: names.length ? names : null };
33
+ }
34
+ catch {
35
+ // 404 (user repo / no types) or a permission error — treat as unavailable.
36
+ cached = { value: null };
37
+ }
38
+ return cached.value;
39
+ }
40
+ // Set an Issue Type on an issue by name. Validates against the org's enabled
41
+ // types (case-insensitive, mapping to the canonical name GitHub expects) and
42
+ // returns { applied } / { skipped } like the board field writes — never throws.
43
+ export async function applyIssueType(issueNumber, type) {
44
+ const skip = (reason) => {
45
+ console.warn(`[okffs] Issue Type "${type}" not set on #${issueNumber}: ${reason}`);
46
+ return { skipped: reason };
47
+ };
48
+ const names = await getIssueTypeNames();
49
+ if (!names) {
50
+ return skip("no org-level Issue Types available — the repo is user-owned, the org has none defined, " +
51
+ "or the token can't read /orgs/{org}/issue-types. Define types under Org → Settings → Planning → Issue Types.");
52
+ }
53
+ const canonical = names.find((n) => n.toLowerCase() === type.toLowerCase());
54
+ if (!canonical) {
55
+ return skip(`no matching type. Available Issue Types: ${names.join(", ")}.`);
56
+ }
57
+ try {
58
+ await setIssueType(issueNumber, canonical);
59
+ return { applied: canonical };
60
+ }
61
+ catch (err) {
62
+ return skip(`write failed — ${err instanceof Error ? err.message : String(err)}`);
63
+ }
64
+ }
65
+ //# sourceMappingURL=issue_types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issue_types.js","sourceRoot":"","sources":["../src/issue_types.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,6EAA6E;AAC7E,+EAA+E;AAC/E,6EAA6E;AAC7E,4EAA4E;AAC5E,gFAAgF;AAChF,EAAE;AACF,+EAA+E;AAC/E,gFAAgF;AAChF,iFAAiF;AACjF,4DAA4D;AAE5D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,2EAA2E;AAC3E,2EAA2E;AAC3E,8EAA8E;AAC9E,wBAAwB;AACxB,IAAI,MAA8C,CAAC;AAEnD,gFAAgF;AAChF,sEAAsE;AACtE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,MAAM,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACzD,CAAC;AAED,8EAA8E;AAC9E,gFAAgF;AAChF,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC;IAChC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,gBAAgB,EAAE,CAAC;QACvC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,C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,CAAC;QACb,OAAO,IAAI,CAAC,kBAAkB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACpF,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"address_pr_review.d.ts","sourceRoot":"","sources":["../../src/prompts/address_pr_review.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,sBAAsB,CAAC;AAExC,eAAO,MAAM,WAAW,kGACyE,CAAC;AAElG,eAAO,MAAM,YAAY;;;;GAMxB,CAAC;AAEF,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;;;;;;;;;EAyB7D"}
1
+ {"version":3,"file":"address_pr_review.d.ts","sourceRoot":"","sources":["../../src/prompts/address_pr_review.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,sBAAsB,CAAC;AAExC,eAAO,MAAM,WAAW,kGACyE,CAAC;AAElG,eAAO,MAAM,YAAY;;;;GAMxB,CAAC;AAEF,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;;;;;;;;;EA2B7D"}
@@ -14,11 +14,13 @@ export function build(args) {
14
14
  ``,
15
15
  `1. Call \`list_pr_review_comments\` for PR #${pr} to read the inline threads and review summaries.`,
16
16
  `2. Triage: decide which comments are valid and in scope. Use your judgment — you don't have to act on every comment, but explain any you intentionally skip.`,
17
- `3. Fix the code for the comments you're addressing. Build/verify if the project supports it.`,
18
- `4. Commit and push the fixes with \`commit_and_update\`.`,
19
- `5. Reply to each addressed thread with \`reply_to_review_comment\` (use the comment id from step 1), briefly noting what you changed and referencing the fix.`,
17
+ `3. Work out WHERE the fixes must land. Normally you commit them straight onto the reviewed PR's own head branch. But if that head is a long-lived, protected integration branch you can't push to directly — the typical case being a promotion / release-gate PR (e.g. \`develop → main\`, head \`develop\`) — \`commit_and_update\` can't push there, so fixes must route through a follow-up PR into the head branch.`,
18
+ `4. Fix the code (build/verify if the project supports it):`,
19
+ ` - Normal PR (head is a feature branch): fix on the head branch, then \`commit_and_update\` to commit + push.`,
20
+ ` - Protected head (promotion/gate PR): create a follow-up issue with \`create_issue\` (it branches off the integration branch), check out that branch, fix there, \`commit_and_update\`, then \`create_pull_request\` to open a PR INTO the head branch — and then MERGE that follow-up PR so the reviewed PR's diff actually contains the fix. The follow-up PR merges into the integration branch (the head), which is allowed; NEVER merge into \`OKFFS_PROTECTED_BRANCH\` autonomously. Don't stop and leave a dangling PR for the user to babysit — complete the loop.`,
21
+ `5. Reply to each addressed thread with \`reply_to_review_comment\` (use the comment id from step 1), briefly noting what you changed and referencing the fix (commit or follow-up PR).`,
20
22
  `6. Post an overall summary of the fixes as a PR comment with \`comment_issue\` (pass the PR number — PRs accept issue comments).`,
21
- `7. For each addressed thread, call \`resolve_review_thread\` with its thread id. It respects \`OKFFS_RESOLVE_THREADS\`: threads are only actually resolved when that env var is enabled, otherwise they're left for the user to resolve.`,
23
+ `7. Resolve threads but ONLY once the fix is actually present on the reviewed PR's branch: immediately after \`commit_and_update\` for a normal PR, or only AFTER the follow-up PR has merged into the head for a protected-head PR (resolving while the fix still sits in an unmerged PR is misleading). Then call \`resolve_review_thread\` with each thread id. It respects \`OKFFS_RESOLVE_THREADS\`: threads are only actually resolved when that env var is enabled (check it — don't assume), otherwise they're left for the user to resolve.`,
22
24
  ``,
23
25
  `Keep replies and the summary concise and specific about what changed.`,
24
26
  ].join("\n");
@@ -1 +1 @@
1
- {"version":3,"file":"address_pr_review.js","sourceRoot":"","sources":["../../src/prompts/address_pr_review.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,mBAAmB,CAAC;AAExC,MAAM,CAAC,MAAM,WAAW,GACtB,+FAA+F,CAAC;AAElG,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B;QACE,I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L;QACxL,kIAAkI;QAClI,uhBAAuhB;QACvhB,EAAE;QACF,uEAAuE;KACxE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,OAAO;QACL,WAAW,EAAE,kCAAkC,EAAE,EAAE;QACnD,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE;aACzC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -10,9 +10,11 @@ export declare const inputSchema: z.ZodObject<{
10
10
  milestone: z.ZodOptional<z.ZodNumber>;
11
11
  priority: z.ZodOptional<z.ZodString>;
12
12
  effort: z.ZodOptional<z.ZodString>;
13
+ type: z.ZodOptional<z.ZodString>;
13
14
  }, "strip", z.ZodTypeAny, {
14
15
  title: string;
15
16
  description: string;
17
+ type?: string | undefined;
16
18
  priority?: string | undefined;
17
19
  effort?: string | undefined;
18
20
  assignees?: string[] | undefined;
@@ -21,6 +23,7 @@ export declare const inputSchema: z.ZodObject<{
21
23
  }, {
22
24
  title: string;
23
25
  description: string;
26
+ type?: string | undefined;
24
27
  priority?: string | undefined;
25
28
  effort?: string | undefined;
26
29
  assignees?: string[] | 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;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"}
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;AAgBxB,eAAO,MAAM,IAAI,iBAAiB,CAAC;AAsCnC,eAAO,MAAM,WAAW,QAA4D,CAAC;AAOrF,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAYtD;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;EAetB,CAAC;AAEH,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;GAyJ/D"}
@@ -1,18 +1,20 @@
1
1
  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
- import { git, currentBranch } from "../git.js";
4
+ import { pushEmptyInitCommit } from "../git.js";
5
5
  import { boardAutoAddEnabled, addIssueToBoard, applyInitialStatus, renderBoardLines, getBoardFieldOptions, } from "../board.js";
6
+ import { applyIssueType, getIssueTypeNames } from "../issue_types.js";
6
7
  export const name = "create_issue";
7
8
  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
9
  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) {
10
+ // Priority/Effort/Type inference guidance is woven into the tool description so
11
+ // Claude uses its own judgement to triage the issue it's creating (like it already
12
+ // does for labels), falling back to OKFFS_DEFAULT_* only when it can't tell. Toggle
13
+ // per field with OKFFS_INFER_PRIORITY / OKFFS_INFER_EFFORT / OKFFS_INFER_TYPE
14
+ // (default on). When the board's real option names / the org's real Issue Type
15
+ // names are known they replace the generic scale so Claude infers against the
16
+ // actual values (#133, #201) — e.g. a P0/P1/P2 board, or an org with Epic/Story.
17
+ function inferenceGuidance(priorityOpts, effortOpts, typeOpts) {
16
18
  const bits = [];
17
19
  if (config.inferPriority) {
18
20
  const scale = priorityOpts?.length ? priorityOpts.join(", ") : "Urgent, High, Medium, Low";
@@ -22,30 +24,37 @@ function inferenceGuidance(priorityOpts, effortOpts) {
22
24
  const scale = effortOpts?.length ? effortOpts.join(", ") : "High, Medium, Low";
23
25
  bits.push(`infer an \`effort\` from the expected amount of work (board options: ${scale})`);
24
26
  }
27
+ if (config.inferType) {
28
+ const scale = typeOpts?.length ? typeOpts.join(", ") : "Task, Bug, Feature";
29
+ bits.push(`infer a \`type\` — the native GitHub Issue Type — from what kind of work it is (org types: ${scale}; e.g. a fix → Bug, a new capability → Feature, a broad multi-issue effort → Epic, a small chore → Task)`);
30
+ }
25
31
  if (bits.length === 0)
26
32
  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.");
33
+ return (` Also ${bits.join(", and ")}, passing the value(s) in the matching parameter. ` +
34
+ "okffs matches these against the board's / org's actual options and falls back to OKFFS_DEFAULT_PRIORITY / OKFFS_DEFAULT_EFFORT / OKFFS_DEFAULT_TYPE when you omit them — so if you genuinely can't judge, omit the field rather than guessing.");
29
35
  }
30
- // Static description (generic scale) — the safe fallback used before the board is
31
- // reachable and whenever real options can't be read.
36
+ // Static description (generic scale) — the safe fallback used before the board /
37
+ // org types are reachable and whenever real options can't be read.
32
38
  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.
39
+ // Dynamic description resolved at tools/list time (index.ts awaits this). Inject
40
+ // the board's real Priority/Effort options (when auto-add is on #133) and the
41
+ // org's real Issue Type names (when type inference is on #201) so Claude infers
42
+ // against them. Any miss falls back to the generic scale. Cheap after the first
43
+ // call — board metadata and org types are memoized.
37
44
  export async function getDescription() {
38
- if (!boardAutoAddEnabled())
39
- return description;
40
- if (!config.inferPriority && !config.inferEffort)
45
+ const boardOn = boardAutoAddEnabled();
46
+ const wantPriority = boardOn && config.inferPriority;
47
+ const wantEffort = boardOn && config.inferEffort;
48
+ if (!wantPriority && !wantEffort && !config.inferType)
41
49
  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),
50
+ const [priorityOpts, effortOpts, typeOpts] = await Promise.all([
51
+ wantPriority ? getBoardFieldOptions("Priority") : Promise.resolve(null),
52
+ wantEffort ? getBoardFieldOptions("Effort") : Promise.resolve(null),
53
+ config.inferType ? getIssueTypeNames() : Promise.resolve(null),
45
54
  ]);
46
- if (!priorityOpts && !effortOpts)
55
+ if (!priorityOpts && !effortOpts && !typeOpts)
47
56
  return description;
48
- return DESCRIPTION_HEAD + inferenceGuidance(priorityOpts, effortOpts) + DESCRIPTION_TAIL;
57
+ return DESCRIPTION_HEAD + inferenceGuidance(priorityOpts, effortOpts, typeOpts) + DESCRIPTION_TAIL;
49
58
  }
50
59
  export const inputSchema = z.object({
51
60
  title: z.string().describe("Issue title"),
@@ -55,15 +64,18 @@ export const inputSchema = z.object({
55
64
  milestone: z.number().int().optional().describe("Milestone number to assign"),
56
65
  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
66
  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."),
67
+ type: z.string().optional().describe("Optional native GitHub Issue Type (e.g. Task, Bug, Feature — plus Epic/Story if the org defines them) — matched against the org's enabled Issue Types. Org-level feature: skipped cleanly on a user-owned repo or when the token can't read them. If omitted, OKFFS_DEFAULT_TYPE is used when set."),
58
68
  });
59
69
  export async function handler(input) {
60
70
  const resolvedAssignees = input.assignees ?? config.defaultAssignees;
61
71
  const resolvedLabels = [
62
72
  ...new Set([...(input.labels ?? []), ...config.defaultLabels])
63
73
  ];
64
- // Fall back to OKFFS_DEFAULT_PRIORITY / OKFFS_DEFAULT_EFFORT when not given.
74
+ // Fall back to OKFFS_DEFAULT_PRIORITY / OKFFS_DEFAULT_EFFORT / OKFFS_DEFAULT_TYPE
75
+ // when not given.
65
76
  const resolvedPriority = input.priority ?? config.defaultPriority;
66
77
  const resolvedEffort = input.effort ?? config.defaultEffort;
78
+ const resolvedType = input.type ?? config.defaultType;
67
79
  const issue = await createIssue(input.title, input.description, resolvedAssignees, resolvedLabels, input.milestone);
68
80
  const branchName = buildBranchName(issue.number, input.title);
69
81
  const defaultBranch = await getDefaultBranch();
@@ -71,6 +83,13 @@ export async function handler(input) {
71
83
  await createBranch(branchName, ref.object.sha);
72
84
  const updatedBody = `${input.description}\n\n**Branch:** \`${branchName}\``;
73
85
  await updateIssueBody(issue.number, updatedBody);
86
+ // Set the native GitHub Issue Type (Task/Bug/Feature/…). Non-fatal, like the
87
+ // board writes: any miss (user repo, no org types, unknown name) is surfaced in
88
+ // the response and never blocks issue creation.
89
+ let typeOutcome = null;
90
+ if (resolvedType) {
91
+ typeOutcome = await applyIssueType(issue.number, resolvedType);
92
+ }
74
93
  // Add the issue to the configured Project board (fallback for users without
75
94
  // native board automation) and set Priority/Effort. Non-fatal, mirroring the
76
95
  // autoPR block below: any failure warns with an [okffs] prefix, is surfaced in
@@ -91,27 +110,13 @@ export async function handler(input) {
91
110
  if (config.autoPR) {
92
111
  // Push an empty init commit so the branch diverges from base, allowing
93
112
  // GitHub to accept a draft PR immediately. Only needed for the auto-PR flow.
94
- const previousBranch = currentBranch();
113
+ // Shared with create_pull_request's allow_empty backfill (#205).
95
114
  try {
96
- git(["fetch", "origin"]);
97
- git(["checkout", branchName]);
98
- git(["commit", "--allow-empty", "-m", `chore: init branch for #${issue.number}`]);
99
- git(["push", "origin", branchName]);
115
+ pushEmptyInitCommit(branchName, issue.number);
100
116
  }
101
117
  catch (err) {
102
118
  console.warn("[okffs] Failed to push init commit:", err instanceof Error ? err.message : err);
103
119
  }
104
- finally {
105
- // Always restore the caller's original branch, even if a step above failed.
106
- if (previousBranch && previousBranch !== branchName) {
107
- try {
108
- git(["checkout", previousBranch]);
109
- }
110
- catch (err) {
111
- console.warn("[okffs] Failed to restore branch:", err instanceof Error ? err.message : err);
112
- }
113
- }
114
- }
115
120
  try {
116
121
  const pr = await createDraftPullRequest(`WIP: #${issue.number} - ${input.title}`, `Closes #${issue.number}`, branchName, defaultBranch);
117
122
  draftPRUrl = pr.html_url;
@@ -145,6 +150,11 @@ export async function handler(input) {
145
150
  const source = input.labels ? "" : " (default)";
146
151
  lines.push(`Labels: ${resolvedLabels.join(", ")}${source}`);
147
152
  }
153
+ if (typeOutcome) {
154
+ lines.push("applied" in typeOutcome
155
+ ? `Type: ${typeOutcome.applied}${input.type ? "" : " (default)"}`
156
+ : `⚠ Type "${resolvedType}" not set — ${typeOutcome.skipped}`);
157
+ }
148
158
  const addedToBoard = Boolean(boardAdd);
149
159
  lines.push(...renderBoardLines({
150
160
  addedToBoard,
@@ -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,EACL,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,GAGrB,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,IAAI,GAAG,cAAc,CAAC;AAEnC,MAAM,gBAAgB,GACpB,2XAA2X,CAAC;AAE9X,MAAM,gBAAgB,GACpB,uNAAuN,CAAC;AAE1N,kFAAkF;AAClF,iFAAiF;AACjF,mFAAmF;AACnF,8EAA8E;AAC9E,+EAA+E;AAC/E,oEAAoE;AACpE,SAAS,iBAAiB,CAAC,YAA8B,EAAE,UAA4B;IACrF,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,2BAA2B,CAAC;QAC3F,IAAI,CAAC,IAAI,CAAC,kFAAkF,KAAK,GAAG,CAAC,CAAC;IACxG,CAAC;IACD,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QAC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O;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. 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.";
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. Also infer a per-task native GitHub Issue Type (Task/Bug/Feature/\u2026) where the org defines them, falling back to OKFFS_DEFAULT_TYPE. Confirms before creating.";
4
4
  export declare const inputSchema: z.ZodObject<{
5
5
  tasks: z.ZodArray<z.ZodObject<{
6
6
  title: z.ZodString;
@@ -10,9 +10,11 @@ export declare const inputSchema: z.ZodObject<{
10
10
  milestone: z.ZodOptional<z.ZodNumber>;
11
11
  priority: z.ZodOptional<z.ZodString>;
12
12
  effort: z.ZodOptional<z.ZodString>;
13
+ type: z.ZodOptional<z.ZodString>;
13
14
  }, "strip", z.ZodTypeAny, {
14
15
  title: string;
15
16
  description: string;
17
+ type?: string | undefined;
16
18
  priority?: string | undefined;
17
19
  effort?: string | undefined;
18
20
  assignees?: string[] | undefined;
@@ -21,6 +23,7 @@ export declare const inputSchema: z.ZodObject<{
21
23
  }, {
22
24
  title: string;
23
25
  description: string;
26
+ type?: string | undefined;
24
27
  priority?: string | undefined;
25
28
  effort?: string | undefined;
26
29
  assignees?: string[] | undefined;
@@ -32,6 +35,7 @@ export declare const inputSchema: z.ZodObject<{
32
35
  tasks: {
33
36
  title: string;
34
37
  description: string;
38
+ type?: string | undefined;
35
39
  priority?: string | undefined;
36
40
  effort?: string | undefined;
37
41
  assignees?: string[] | undefined;
@@ -43,6 +47,7 @@ export declare const inputSchema: z.ZodObject<{
43
47
  tasks: {
44
48
  title: string;
45
49
  description: string;
50
+ type?: string | undefined;
46
51
  priority?: string | undefined;
47
52
  effort?: string | undefined;
48
53
  assignees?: string[] | 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;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"}
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;AAcxB,eAAO,MAAM,IAAI,4BAA4B,CAAC;AAE9C,eAAO,MAAM,WAAW,ixBAC8uB,CAAC;AAmBvwB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtB,CAAC;AAEH,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;GAqF/D"}
@@ -2,8 +2,9 @@ import { z } from "zod";
2
2
  import { createIssue, updateIssueBody, getDefaultBranch, getRef, createBranch, buildBranchName } from "../github.js";
3
3
  import { config } from "../config.js";
4
4
  import { boardAutoAddEnabled, addIssueToBoard, applyInitialStatus, renderBoardLines, } from "../board.js";
5
+ import { applyIssueType } from "../issue_types.js";
5
6
  export const name = "create_issues_from_list";
6
- export 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 — infer a per-task priority/effort where you can, falling back to OKFFS_DEFAULT_PRIORITY/EFFORT. Confirms before creating.";
7
+ export 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 — infer a per-task priority/effort where you can, falling back to OKFFS_DEFAULT_PRIORITY/EFFORT. Also infer a per-task native GitHub Issue Type (Task/Bug/Feature/…) where the org defines them, falling back to OKFFS_DEFAULT_TYPE. Confirms before creating.";
7
8
  const taskSchema = z.object({
8
9
  title: z.string().describe("Issue title"),
9
10
  description: z.string().describe("Issue body / description"),
@@ -12,6 +13,7 @@ const taskSchema = z.object({
12
13
  milestone: z.number().int().optional().describe("Milestone number to assign"),
13
14
  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."),
14
15
  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."),
16
+ 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."),
15
17
  });
16
18
  export const inputSchema = z.object({
17
19
  tasks: z.array(taskSchema).min(1).describe("List of issues to create"),
@@ -39,11 +41,17 @@ export async function handler(input) {
39
41
  ];
40
42
  const resolvedPriority = task.priority ?? config.defaultPriority;
41
43
  const resolvedEffort = task.effort ?? config.defaultEffort;
44
+ const resolvedType = task.type ?? config.defaultType;
42
45
  const issue = await createIssue(task.title, task.description, resolvedAssignees, resolvedLabels, task.milestone);
43
46
  const branchName = buildBranchName(issue.number, task.title);
44
47
  await createBranch(branchName, ref.object.sha);
45
48
  const updatedBody = `${task.description}\n\n**Branch:** \`${branchName}\``;
46
49
  await updateIssueBody(issue.number, updatedBody);
50
+ // Native Issue Type — non-fatal per task, surfaced in the entry below.
51
+ let typeOutcome = null;
52
+ if (resolvedType) {
53
+ typeOutcome = await applyIssueType(issue.number, resolvedType);
54
+ }
47
55
  // Board placement, mirroring create_issue. Non-fatal per task and surfaced in
48
56
  // the response — never silent (#144, #146). No draft PR here, so the initial
49
57
  // status has no linked-PR race to win and can be applied right away.
@@ -76,6 +84,11 @@ export async function handler(input) {
76
84
  initialStatus,
77
85
  indent: " ",
78
86
  }));
87
+ if (typeOutcome) {
88
+ entryLines.push("applied" in typeOutcome
89
+ ? ` Type: ${typeOutcome.applied}`
90
+ : ` ⚠ Type "${resolvedType}" not set — ${typeOutcome.skipped}`);
91
+ }
79
92
  results.push(entryLines.join("\n"));
80
93
  }
81
94
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"create_issues_from_list.js","sourceRoot":"","sources":["../../src/tools/create_issues_from_list.ts"],"names":[],"mappings":"AA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AAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;KAC7G,CAAC;AACJ,CAAC"}
@@ -1,21 +1,21 @@
1
1
  import { z } from "zod";
2
2
  export declare const name = "create_pull_request";
3
- export declare const description = "Create a pull request for the current issue branch. Reads the issue, its comments, and commits to generate a PR title and body. Always includes Closes #N. If OKFFS_UPDATE_DOCS is true, writes a per-issue changelog fragment under .changes/unreleased/ (assembled into CHANGELOG.md at release time by prepare_release \u2014 not a direct CHANGELOG.md edit), plus SECURITY.md for security-related changes, and commits them onto the branch before creating the PR. If a PR already exists for the branch (e.g. a draft opened by create_issue under OKFFS_AUTO_PR=true), it is updated and marked ready for review instead of erroring. Posts a summary comment to the issue. If the issue has no okffs-created branch link (no **Branch:** line \u2014 e.g. a pre-okffs issue or a hand-made branch), pass an explicit branch, or check out a branch named {issue-number}-\u2026 and okffs infers it; either way it backfills the **Branch:** line. If the PR would target OKFFS_PROTECTED_BRANCH, the tool refuses without confirmed: true \u2014 promoting into a protected branch must be explicitly confirmed by the user.";
3
+ export declare const description = "Create a pull request for the current issue branch. Reads the issue, its comments, and commits to generate a PR title and body. Always includes Closes #N. If OKFFS_UPDATE_DOCS is true, writes a per-issue changelog fragment under .changes/unreleased/ (assembled into CHANGELOG.md at release time by prepare_release \u2014 not a direct CHANGELOG.md edit), plus SECURITY.md for security-related changes, and commits them onto the branch before creating the PR. If a PR already exists for the branch (e.g. a draft opened by create_issue under OKFFS_AUTO_PR=true), it is updated and marked ready for review instead of erroring. By default, a branch with no commits ahead of base is refused (a PR needs a diff); pass allow_empty: true to instead push an empty init commit so the branch diverges and open a **draft** tracking PR \u2014 the same mechanism create_issue uses under OKFFS_AUTO_PR, for backfilling a PR onto a branch that was created empty. Posts a summary comment to the issue. If the issue has no okffs-created branch link (no **Branch:** line \u2014 e.g. a pre-okffs issue or a hand-made branch), pass an explicit branch, or check out a branch named {issue-number}-\u2026 and okffs infers it; either way it backfills the **Branch:** line. If the PR targets OKFFS_PROTECTED_BRANCH, okffs still opens it (opening is safe and reversible) and adds a reminder that the merge/tag stay with the user \u2014 OKFFS_PROTECTED_BRANCH governs autonomous merging, never PR creation.";
4
4
  export declare const inputSchema: z.ZodObject<{
5
5
  issue_number: z.ZodNumber;
6
6
  summary: z.ZodOptional<z.ZodString>;
7
7
  branch: z.ZodOptional<z.ZodString>;
8
- confirmed: z.ZodOptional<z.ZodBoolean>;
8
+ allow_empty: z.ZodOptional<z.ZodBoolean>;
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  issue_number: number;
11
- confirmed?: boolean | undefined;
12
11
  summary?: string | undefined;
13
12
  branch?: string | undefined;
13
+ allow_empty?: boolean | undefined;
14
14
  }, {
15
15
  issue_number: number;
16
- confirmed?: boolean | undefined;
17
16
  summary?: string | undefined;
18
17
  branch?: string | undefined;
18
+ allow_empty?: boolean | undefined;
19
19
  }>;
20
20
  export declare function handler(input: z.infer<typeof inputSchema>): Promise<{
21
21
  content: {
@@ -1 +1 @@
1
- {"version":3,"file":"create_pull_request.d.ts","sourceRoot":"","sources":["../../src/tools/create_pull_request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,IAAI,wBAAwB,CAAC;AAE1C,eAAO,MAAM,WAAW,2kCAC8hC,CAAC;AAEvjC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EAKtB,CAAC;AAEH,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;GA4O/D"}
1
+ {"version":3,"file":"create_pull_request.d.ts","sourceRoot":"","sources":["../../src/tools/create_pull_request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,IAAI,wBAAwB,CAAC;AAE1C,eAAO,MAAM,WAAW,08CACw5C,CAAC;AAEj7C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EAKtB,CAAC;AAEH,wBAAsB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC;;;;;GAmQ/D"}