techunter 0.1.0 → 0.1.1
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/README.md +1 -1
- package/dist/index.js +310 -159
- package/dist/mcp.js +204 -101
- package/package.json +2 -2
package/dist/mcp.js
CHANGED
|
@@ -17,6 +17,7 @@ __export(github_exports, {
|
|
|
17
17
|
closeTask: () => closeTask,
|
|
18
18
|
createPR: () => createPR,
|
|
19
19
|
createTask: () => createTask,
|
|
20
|
+
editTask: () => editTask,
|
|
20
21
|
ensureLabels: () => ensureLabels,
|
|
21
22
|
formatGuideAsMarkdown: () => formatGuideAsMarkdown,
|
|
22
23
|
getAuthenticatedUser: () => getAuthenticatedUser,
|
|
@@ -59,46 +60,15 @@ function parseIssue(issue) {
|
|
|
59
60
|
async function listTasks(config) {
|
|
60
61
|
const octokit = createOctokit(config.githubToken);
|
|
61
62
|
const { owner, repo } = config.github;
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
owner,
|
|
72
|
-
repo,
|
|
73
|
-
labels: LABEL_CLAIMED,
|
|
74
|
-
state: "open",
|
|
75
|
-
per_page: 50
|
|
76
|
-
}),
|
|
77
|
-
octokit.issues.listForRepo({
|
|
78
|
-
owner,
|
|
79
|
-
repo,
|
|
80
|
-
labels: LABEL_IN_REVIEW,
|
|
81
|
-
state: "open",
|
|
82
|
-
per_page: 50
|
|
83
|
-
}),
|
|
84
|
-
octokit.issues.listForRepo({
|
|
85
|
-
owner,
|
|
86
|
-
repo,
|
|
87
|
-
labels: LABEL_CHANGES_NEEDED,
|
|
88
|
-
state: "open",
|
|
89
|
-
per_page: 50
|
|
90
|
-
})
|
|
91
|
-
]);
|
|
92
|
-
const allIssues = [...available.data, ...claimed.data, ...inReview.data, ...changesNeeded.data];
|
|
93
|
-
const seen = /* @__PURE__ */ new Set();
|
|
94
|
-
const unique = [];
|
|
95
|
-
for (const issue of allIssues) {
|
|
96
|
-
if (!seen.has(issue.number)) {
|
|
97
|
-
seen.add(issue.number);
|
|
98
|
-
unique.push(parseIssue(issue));
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return unique.sort((a, b) => a.number - b.number);
|
|
63
|
+
const { data } = await octokit.issues.listForRepo({
|
|
64
|
+
owner,
|
|
65
|
+
repo,
|
|
66
|
+
state: "open",
|
|
67
|
+
per_page: 100
|
|
68
|
+
});
|
|
69
|
+
return data.filter(
|
|
70
|
+
(issue) => !issue.pull_request && issue.labels.some((l) => TECHUNTER_LABELS.has(l.name ?? ""))
|
|
71
|
+
).map(parseIssue).sort((a, b) => a.number - b.number);
|
|
102
72
|
}
|
|
103
73
|
async function getTask(config, number) {
|
|
104
74
|
const octokit = createOctokit(config.githubToken);
|
|
@@ -316,6 +286,11 @@ async function ensureLabels(config) {
|
|
|
316
286
|
)
|
|
317
287
|
);
|
|
318
288
|
}
|
|
289
|
+
async function editTask(config, number, title, body) {
|
|
290
|
+
const octokit = createOctokit(config.githubToken);
|
|
291
|
+
const { owner, repo } = config.github;
|
|
292
|
+
await octokit.issues.update({ owner, repo, issue_number: number, title, body });
|
|
293
|
+
}
|
|
319
294
|
async function getDefaultBranch(config) {
|
|
320
295
|
const octokit = createOctokit(config.githubToken);
|
|
321
296
|
const { owner, repo } = config.github;
|
|
@@ -341,7 +316,7 @@ async function acceptTask(config, issueNumber) {
|
|
|
341
316
|
await closeTask(config, issueNumber);
|
|
342
317
|
return { prNumber: pr.number, prUrl: pr.html_url, sha: merge.sha ?? "" };
|
|
343
318
|
}
|
|
344
|
-
var LABEL_AVAILABLE, LABEL_CLAIMED, LABEL_IN_REVIEW, LABEL_CHANGES_NEEDED, LABELS;
|
|
319
|
+
var LABEL_AVAILABLE, LABEL_CLAIMED, LABEL_IN_REVIEW, LABEL_CHANGES_NEEDED, LABELS, TECHUNTER_LABELS;
|
|
345
320
|
var init_github = __esm({
|
|
346
321
|
"src/lib/github.ts"() {
|
|
347
322
|
"use strict";
|
|
@@ -355,6 +330,7 @@ var init_github = __esm({
|
|
|
355
330
|
{ name: LABEL_IN_REVIEW, color: "0075ca", description: "Task submitted for review" },
|
|
356
331
|
{ name: LABEL_CHANGES_NEEDED, color: "e11d48", description: "Task needs changes" }
|
|
357
332
|
];
|
|
333
|
+
TECHUNTER_LABELS = /* @__PURE__ */ new Set([LABEL_AVAILABLE, LABEL_CLAIMED, LABEL_IN_REVIEW, LABEL_CHANGES_NEEDED]);
|
|
358
334
|
}
|
|
359
335
|
});
|
|
360
336
|
|
|
@@ -692,7 +668,7 @@ var definition = {
|
|
|
692
668
|
}
|
|
693
669
|
}
|
|
694
670
|
};
|
|
695
|
-
async function run(config) {
|
|
671
|
+
async function run(_input, config) {
|
|
696
672
|
const branch = await getCurrentBranch();
|
|
697
673
|
const match = branch.match(/^task-(\d+)-/);
|
|
698
674
|
if (!match) {
|
|
@@ -853,8 +829,8 @@ var definition2 = {
|
|
|
853
829
|
}
|
|
854
830
|
}
|
|
855
831
|
};
|
|
856
|
-
async function run2(
|
|
857
|
-
let issueNumber =
|
|
832
|
+
async function run2(input, config) {
|
|
833
|
+
let issueNumber = input["issue_number"];
|
|
858
834
|
if (!issueNumber) {
|
|
859
835
|
let tasks;
|
|
860
836
|
try {
|
|
@@ -929,7 +905,8 @@ var definition3 = {
|
|
|
929
905
|
}
|
|
930
906
|
}
|
|
931
907
|
};
|
|
932
|
-
async function run3(
|
|
908
|
+
async function run3(input, config) {
|
|
909
|
+
const preselected = input["issue_number"];
|
|
933
910
|
let chosenNumber;
|
|
934
911
|
if (preselected !== void 0) {
|
|
935
912
|
chosenNumber = preselected;
|
|
@@ -1041,8 +1018,8 @@ Finish or submit it before claiming a new one.`;
|
|
|
1041
1018
|
return `Error claiming task: ${err.message}`;
|
|
1042
1019
|
}
|
|
1043
1020
|
}
|
|
1044
|
-
if (action === "submit") return run(config);
|
|
1045
|
-
if (action === "close") return run2(
|
|
1021
|
+
if (action === "submit") return run({}, config);
|
|
1022
|
+
if (action === "close") return run2({ issue_number: issue.number }, config);
|
|
1046
1023
|
return "Cancelled.";
|
|
1047
1024
|
}
|
|
1048
1025
|
async function execute3(input, config) {
|
|
@@ -1173,8 +1150,8 @@ var definition4 = {
|
|
|
1173
1150
|
}
|
|
1174
1151
|
}
|
|
1175
1152
|
};
|
|
1176
|
-
async function run4(
|
|
1177
|
-
let title =
|
|
1153
|
+
async function run4(input, config) {
|
|
1154
|
+
let title = input["title"]?.trim();
|
|
1178
1155
|
if (!title) {
|
|
1179
1156
|
try {
|
|
1180
1157
|
title = (await promptInput2({ message: "Task title:" })).trim();
|
|
@@ -1307,7 +1284,7 @@ var definition5 = {
|
|
|
1307
1284
|
parameters: { type: "object", properties: {}, required: [] }
|
|
1308
1285
|
}
|
|
1309
1286
|
};
|
|
1310
|
-
async function run5(config) {
|
|
1287
|
+
async function run5(_input, config) {
|
|
1311
1288
|
const spinner = ora5("Fetching your tasks\u2026").start();
|
|
1312
1289
|
try {
|
|
1313
1290
|
const me = await getAuthenticatedUser(config);
|
|
@@ -1322,7 +1299,7 @@ ${lines.join("\n")}`;
|
|
|
1322
1299
|
return `Error: ${err.message}`;
|
|
1323
1300
|
}
|
|
1324
1301
|
}
|
|
1325
|
-
var execute5 =
|
|
1302
|
+
var execute5 = run5;
|
|
1326
1303
|
var terminal5 = true;
|
|
1327
1304
|
|
|
1328
1305
|
// src/tools/review/index.ts
|
|
@@ -1343,7 +1320,7 @@ var definition6 = {
|
|
|
1343
1320
|
parameters: { type: "object", properties: {}, required: [] }
|
|
1344
1321
|
}
|
|
1345
1322
|
};
|
|
1346
|
-
async function run6(config) {
|
|
1323
|
+
async function run6(_input, config) {
|
|
1347
1324
|
const spinner = ora6("Loading tasks for review\u2026").start();
|
|
1348
1325
|
try {
|
|
1349
1326
|
const me = await getAuthenticatedUser(config);
|
|
@@ -1358,7 +1335,7 @@ ${lines.join("\n")}`;
|
|
|
1358
1335
|
return `Error: ${err.message}`;
|
|
1359
1336
|
}
|
|
1360
1337
|
}
|
|
1361
|
-
var execute6 =
|
|
1338
|
+
var execute6 = run6;
|
|
1362
1339
|
var terminal6 = true;
|
|
1363
1340
|
|
|
1364
1341
|
// src/tools/refresh/index.ts
|
|
@@ -1377,7 +1354,7 @@ var definition7 = {
|
|
|
1377
1354
|
parameters: { type: "object", properties: {}, required: [] }
|
|
1378
1355
|
}
|
|
1379
1356
|
};
|
|
1380
|
-
async function run7(config) {
|
|
1357
|
+
async function run7(_input, config) {
|
|
1381
1358
|
const tasks = await printTaskList(config);
|
|
1382
1359
|
if (tasks.length === 0) return "No tasks found.";
|
|
1383
1360
|
const lines = tasks.map((t) => {
|
|
@@ -1388,7 +1365,7 @@ async function run7(config) {
|
|
|
1388
1365
|
return `Tasks (${tasks.length}):
|
|
1389
1366
|
${lines.join("\n")}`;
|
|
1390
1367
|
}
|
|
1391
|
-
var execute7 =
|
|
1368
|
+
var execute7 = run7;
|
|
1392
1369
|
var terminal7 = true;
|
|
1393
1370
|
|
|
1394
1371
|
// src/tools/open-code/index.ts
|
|
@@ -1408,7 +1385,7 @@ var definition8 = {
|
|
|
1408
1385
|
parameters: { type: "object", properties: {}, required: [] }
|
|
1409
1386
|
}
|
|
1410
1387
|
};
|
|
1411
|
-
async function run8(config) {
|
|
1388
|
+
async function run8(_input, config) {
|
|
1412
1389
|
let branch;
|
|
1413
1390
|
try {
|
|
1414
1391
|
branch = await getCurrentBranch();
|
|
@@ -1427,7 +1404,7 @@ async function run8(config) {
|
|
|
1427
1404
|
await launchClaudeCode(issue, branch);
|
|
1428
1405
|
return "Claude Code session ended.";
|
|
1429
1406
|
}
|
|
1430
|
-
var execute8 =
|
|
1407
|
+
var execute8 = run8;
|
|
1431
1408
|
var terminal8 = true;
|
|
1432
1409
|
|
|
1433
1410
|
// src/tools/reject/index.ts
|
|
@@ -1487,8 +1464,8 @@ var definition9 = {
|
|
|
1487
1464
|
}
|
|
1488
1465
|
}
|
|
1489
1466
|
};
|
|
1490
|
-
async function run9(
|
|
1491
|
-
const
|
|
1467
|
+
async function run9(input, config) {
|
|
1468
|
+
const issueNumber = input["issue_number"];
|
|
1492
1469
|
let feedback;
|
|
1493
1470
|
try {
|
|
1494
1471
|
feedback = await promptInput3({
|
|
@@ -1607,8 +1584,8 @@ var definition10 = {
|
|
|
1607
1584
|
}
|
|
1608
1585
|
}
|
|
1609
1586
|
};
|
|
1610
|
-
async function run10(
|
|
1611
|
-
let issueNumber =
|
|
1587
|
+
async function run10(input, config) {
|
|
1588
|
+
let issueNumber = input["issue_number"];
|
|
1612
1589
|
if (!issueNumber) {
|
|
1613
1590
|
const spinner2 = ora8("Loading tasks for review\u2026").start();
|
|
1614
1591
|
let tasks;
|
|
@@ -1677,14 +1654,138 @@ Issue closed.`;
|
|
|
1677
1654
|
}
|
|
1678
1655
|
var terminal10 = true;
|
|
1679
1656
|
|
|
1657
|
+
// src/tools/edit-task/index.ts
|
|
1658
|
+
var edit_task_exports = {};
|
|
1659
|
+
__export(edit_task_exports, {
|
|
1660
|
+
definition: () => definition11,
|
|
1661
|
+
execute: () => execute11,
|
|
1662
|
+
run: () => run11,
|
|
1663
|
+
terminal: () => terminal11
|
|
1664
|
+
});
|
|
1665
|
+
init_github();
|
|
1666
|
+
import { select as select7, input as promptInput4 } from "@inquirer/prompts";
|
|
1667
|
+
import ora9 from "ora";
|
|
1668
|
+
var definition11 = {
|
|
1669
|
+
type: "function",
|
|
1670
|
+
function: {
|
|
1671
|
+
name: "edit_task",
|
|
1672
|
+
description: "Edit the title and/or body of an existing task (GitHub Issue). Equivalent to /edit.",
|
|
1673
|
+
parameters: {
|
|
1674
|
+
type: "object",
|
|
1675
|
+
properties: {
|
|
1676
|
+
issue_number: { type: "number", description: "Issue number to edit." },
|
|
1677
|
+
title: { type: "string", description: "New title." },
|
|
1678
|
+
body: { type: "string", description: "New body/description." }
|
|
1679
|
+
},
|
|
1680
|
+
required: ["issue_number", "title", "body"]
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
};
|
|
1684
|
+
async function run11(input, config) {
|
|
1685
|
+
let issueNumber = input["issue_number"];
|
|
1686
|
+
if (!issueNumber) {
|
|
1687
|
+
let tasks;
|
|
1688
|
+
try {
|
|
1689
|
+
tasks = await listTasks(config);
|
|
1690
|
+
} catch (err) {
|
|
1691
|
+
return `Error loading tasks: ${err.message}`;
|
|
1692
|
+
}
|
|
1693
|
+
if (tasks.length === 0) return "No tasks found.";
|
|
1694
|
+
try {
|
|
1695
|
+
issueNumber = await select7({
|
|
1696
|
+
message: "Select task to edit:",
|
|
1697
|
+
choices: tasks.map((t) => ({ name: `#${t.number} [${getStatus(t)}] ${t.title}`, value: t.number }))
|
|
1698
|
+
});
|
|
1699
|
+
} catch {
|
|
1700
|
+
return "Cancelled.";
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
let issue;
|
|
1704
|
+
try {
|
|
1705
|
+
issue = await getTask(config, issueNumber);
|
|
1706
|
+
} catch (err) {
|
|
1707
|
+
return `Error loading task: ${err.message}`;
|
|
1708
|
+
}
|
|
1709
|
+
let title;
|
|
1710
|
+
let body;
|
|
1711
|
+
try {
|
|
1712
|
+
title = await promptInput4({
|
|
1713
|
+
message: "Title:",
|
|
1714
|
+
default: issue.title
|
|
1715
|
+
});
|
|
1716
|
+
body = await promptInput4({
|
|
1717
|
+
message: "Description:",
|
|
1718
|
+
default: issue.body ?? ""
|
|
1719
|
+
});
|
|
1720
|
+
} catch {
|
|
1721
|
+
return "Cancelled.";
|
|
1722
|
+
}
|
|
1723
|
+
if (title.trim() === issue.title && body.trim() === (issue.body ?? "")) {
|
|
1724
|
+
return "No changes made.";
|
|
1725
|
+
}
|
|
1726
|
+
const spinner = ora9(`Updating #${issueNumber}\u2026`).start();
|
|
1727
|
+
try {
|
|
1728
|
+
await editTask(config, issueNumber, title.trim() || issue.title, body.trim());
|
|
1729
|
+
spinner.stop();
|
|
1730
|
+
return `Task #${issueNumber} updated.`;
|
|
1731
|
+
} catch (err) {
|
|
1732
|
+
spinner.stop();
|
|
1733
|
+
return `Error: ${err.message}`;
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
async function execute11(input, config) {
|
|
1737
|
+
const issueNumber = input["issue_number"];
|
|
1738
|
+
const title = input["title"];
|
|
1739
|
+
const body = input["body"];
|
|
1740
|
+
const spinner = ora9(`Updating #${issueNumber}\u2026`).start();
|
|
1741
|
+
try {
|
|
1742
|
+
await editTask(config, issueNumber, title, body);
|
|
1743
|
+
spinner.stop();
|
|
1744
|
+
return `Task #${issueNumber} updated.`;
|
|
1745
|
+
} catch (err) {
|
|
1746
|
+
spinner.stop();
|
|
1747
|
+
return `Error: ${err.message}`;
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
var terminal11 = true;
|
|
1751
|
+
|
|
1752
|
+
// src/tools/list-tasks/index.ts
|
|
1753
|
+
var list_tasks_exports = {};
|
|
1754
|
+
__export(list_tasks_exports, {
|
|
1755
|
+
definition: () => definition12,
|
|
1756
|
+
execute: () => execute12
|
|
1757
|
+
});
|
|
1758
|
+
init_github();
|
|
1759
|
+
var definition12 = {
|
|
1760
|
+
type: "function",
|
|
1761
|
+
function: {
|
|
1762
|
+
name: "list_tasks",
|
|
1763
|
+
description: "List all open tasks (GitHub Issues) with their status and assignee. Use this to answer questions about available work, task progress, or who is working on what.",
|
|
1764
|
+
parameters: {
|
|
1765
|
+
type: "object",
|
|
1766
|
+
properties: {},
|
|
1767
|
+
required: []
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
};
|
|
1771
|
+
async function execute12(_input, config) {
|
|
1772
|
+
const tasks = await listTasks(config);
|
|
1773
|
+
if (tasks.length === 0) return "No open tasks.";
|
|
1774
|
+
return tasks.map((t) => {
|
|
1775
|
+
const status = t.labels.find((l) => l.startsWith("techunter:"))?.replace("techunter:", "") ?? "unknown";
|
|
1776
|
+
const assignee = t.assignee ? `@${t.assignee}` : "\u2014";
|
|
1777
|
+
return `#${t.number} [${status}] ${assignee} ${t.title}`;
|
|
1778
|
+
}).join("\n");
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1680
1781
|
// src/tools/get-task/index.ts
|
|
1681
1782
|
var get_task_exports = {};
|
|
1682
1783
|
__export(get_task_exports, {
|
|
1683
|
-
definition: () =>
|
|
1684
|
-
execute: () =>
|
|
1784
|
+
definition: () => definition13,
|
|
1785
|
+
execute: () => execute13
|
|
1685
1786
|
});
|
|
1686
1787
|
init_github();
|
|
1687
|
-
var
|
|
1788
|
+
var definition13 = {
|
|
1688
1789
|
type: "function",
|
|
1689
1790
|
function: {
|
|
1690
1791
|
name: "get_task",
|
|
@@ -1698,7 +1799,7 @@ var definition11 = {
|
|
|
1698
1799
|
}
|
|
1699
1800
|
}
|
|
1700
1801
|
};
|
|
1701
|
-
async function
|
|
1802
|
+
async function execute13(input, config) {
|
|
1702
1803
|
const issue = await getTask(config, input["issue_number"]);
|
|
1703
1804
|
const status = issue.labels.find((l) => l.startsWith("techunter:"))?.replace("techunter:", "") ?? "unknown";
|
|
1704
1805
|
const assignee = issue.assignee ? `@${issue.assignee}` : "\u2014";
|
|
@@ -1715,12 +1816,12 @@ ${issue.body}`);
|
|
|
1715
1816
|
// src/tools/get-comments/index.ts
|
|
1716
1817
|
var get_comments_exports = {};
|
|
1717
1818
|
__export(get_comments_exports, {
|
|
1718
|
-
definition: () =>
|
|
1719
|
-
execute: () =>
|
|
1819
|
+
definition: () => definition14,
|
|
1820
|
+
execute: () => execute14
|
|
1720
1821
|
});
|
|
1721
1822
|
init_github();
|
|
1722
|
-
import
|
|
1723
|
-
var
|
|
1823
|
+
import ora10 from "ora";
|
|
1824
|
+
var definition14 = {
|
|
1724
1825
|
type: "function",
|
|
1725
1826
|
function: {
|
|
1726
1827
|
name: "get_comments",
|
|
@@ -1735,10 +1836,10 @@ var definition12 = {
|
|
|
1735
1836
|
}
|
|
1736
1837
|
}
|
|
1737
1838
|
};
|
|
1738
|
-
async function
|
|
1839
|
+
async function execute14(input, config) {
|
|
1739
1840
|
const issueNumber = input["issue_number"];
|
|
1740
1841
|
const limit = input["limit"] ?? 5;
|
|
1741
|
-
const spinner =
|
|
1842
|
+
const spinner = ora10(`Loading comments for #${issueNumber}...`).start();
|
|
1742
1843
|
try {
|
|
1743
1844
|
const comments = await listComments(config, issueNumber, limit);
|
|
1744
1845
|
spinner.stop();
|
|
@@ -1757,11 +1858,11 @@ ${lines.join("\n\n")}`;
|
|
|
1757
1858
|
// src/tools/get-diff/index.ts
|
|
1758
1859
|
var get_diff_exports = {};
|
|
1759
1860
|
__export(get_diff_exports, {
|
|
1760
|
-
definition: () =>
|
|
1761
|
-
execute: () =>
|
|
1861
|
+
definition: () => definition15,
|
|
1862
|
+
execute: () => execute15
|
|
1762
1863
|
});
|
|
1763
|
-
import
|
|
1764
|
-
var
|
|
1864
|
+
import ora11 from "ora";
|
|
1865
|
+
var definition15 = {
|
|
1765
1866
|
type: "function",
|
|
1766
1867
|
function: {
|
|
1767
1868
|
name: "get_diff",
|
|
@@ -1769,8 +1870,8 @@ var definition13 = {
|
|
|
1769
1870
|
parameters: { type: "object", properties: {}, required: [] }
|
|
1770
1871
|
}
|
|
1771
1872
|
};
|
|
1772
|
-
async function
|
|
1773
|
-
const spinner =
|
|
1873
|
+
async function execute15(_input, _config) {
|
|
1874
|
+
const spinner = ora11("Reading git diff...").start();
|
|
1774
1875
|
try {
|
|
1775
1876
|
const diff = await getDiff(_config.github.baseBranch);
|
|
1776
1877
|
spinner.stop();
|
|
@@ -1784,14 +1885,14 @@ async function execute13(_input, _config) {
|
|
|
1784
1885
|
// src/tools/run-command/index.ts
|
|
1785
1886
|
var run_command_exports = {};
|
|
1786
1887
|
__export(run_command_exports, {
|
|
1787
|
-
definition: () =>
|
|
1788
|
-
execute: () =>
|
|
1888
|
+
definition: () => definition16,
|
|
1889
|
+
execute: () => execute16
|
|
1789
1890
|
});
|
|
1790
1891
|
import { exec } from "child_process";
|
|
1791
1892
|
import { promisify } from "util";
|
|
1792
|
-
import
|
|
1893
|
+
import ora12 from "ora";
|
|
1793
1894
|
var execAsync = promisify(exec);
|
|
1794
|
-
var
|
|
1895
|
+
var definition16 = {
|
|
1795
1896
|
type: "function",
|
|
1796
1897
|
function: {
|
|
1797
1898
|
name: "run_command",
|
|
@@ -1805,10 +1906,10 @@ var definition14 = {
|
|
|
1805
1906
|
}
|
|
1806
1907
|
}
|
|
1807
1908
|
};
|
|
1808
|
-
async function
|
|
1909
|
+
async function execute16(input, _config) {
|
|
1809
1910
|
const command = input["command"];
|
|
1810
1911
|
const cwd = process.cwd();
|
|
1811
|
-
const spinner =
|
|
1912
|
+
const spinner = ora12(`$ ${command}`).start();
|
|
1812
1913
|
try {
|
|
1813
1914
|
const { stdout, stderr } = await execAsync(command, { cwd, timeout: 6e4, maxBuffer: 1024 * 1024 });
|
|
1814
1915
|
spinner.stop();
|
|
@@ -1827,10 +1928,10 @@ ${out || e.message}`;
|
|
|
1827
1928
|
// src/tools/scan-project/index.ts
|
|
1828
1929
|
var scan_project_exports = {};
|
|
1829
1930
|
__export(scan_project_exports, {
|
|
1830
|
-
definition: () =>
|
|
1831
|
-
execute: () =>
|
|
1931
|
+
definition: () => definition17,
|
|
1932
|
+
execute: () => execute17
|
|
1832
1933
|
});
|
|
1833
|
-
import
|
|
1934
|
+
import ora13 from "ora";
|
|
1834
1935
|
|
|
1835
1936
|
// src/lib/project.ts
|
|
1836
1937
|
import { readFile as readFile2 } from "fs/promises";
|
|
@@ -1981,7 +2082,7 @@ async function buildProjectContext(cwd, issueTitle, issueBody) {
|
|
|
1981
2082
|
}
|
|
1982
2083
|
|
|
1983
2084
|
// src/tools/scan-project/index.ts
|
|
1984
|
-
var
|
|
2085
|
+
var definition17 = {
|
|
1985
2086
|
type: "function",
|
|
1986
2087
|
function: {
|
|
1987
2088
|
name: "scan_project",
|
|
@@ -1998,9 +2099,9 @@ var definition15 = {
|
|
|
1998
2099
|
}
|
|
1999
2100
|
}
|
|
2000
2101
|
};
|
|
2001
|
-
async function
|
|
2102
|
+
async function execute17(input, _config) {
|
|
2002
2103
|
const focus = input["focus"] ?? "";
|
|
2003
|
-
const spinner =
|
|
2104
|
+
const spinner = ora13("Scanning project...").start();
|
|
2004
2105
|
try {
|
|
2005
2106
|
const cwd = process.cwd();
|
|
2006
2107
|
const context = await buildProjectContext(cwd, focus, "");
|
|
@@ -2029,12 +2130,12 @@ ${content}
|
|
|
2029
2130
|
// src/tools/read-file/index.ts
|
|
2030
2131
|
var read_file_exports = {};
|
|
2031
2132
|
__export(read_file_exports, {
|
|
2032
|
-
definition: () =>
|
|
2033
|
-
execute: () =>
|
|
2133
|
+
definition: () => definition18,
|
|
2134
|
+
execute: () => execute18
|
|
2034
2135
|
});
|
|
2035
2136
|
import { readFile as readFile3 } from "fs/promises";
|
|
2036
2137
|
import path3 from "path";
|
|
2037
|
-
var
|
|
2138
|
+
var definition18 = {
|
|
2038
2139
|
type: "function",
|
|
2039
2140
|
function: {
|
|
2040
2141
|
name: "read_file",
|
|
@@ -2048,7 +2149,7 @@ var definition16 = {
|
|
|
2048
2149
|
}
|
|
2049
2150
|
}
|
|
2050
2151
|
};
|
|
2051
|
-
async function
|
|
2152
|
+
async function execute18(input, _config) {
|
|
2052
2153
|
const filePath = input["path"];
|
|
2053
2154
|
try {
|
|
2054
2155
|
const fullPath = path3.join(process.cwd(), filePath);
|
|
@@ -2062,12 +2163,12 @@ async function execute16(input, _config) {
|
|
|
2062
2163
|
// src/tools/ask-user/index.ts
|
|
2063
2164
|
var ask_user_exports = {};
|
|
2064
2165
|
__export(ask_user_exports, {
|
|
2065
|
-
definition: () =>
|
|
2066
|
-
execute: () =>
|
|
2166
|
+
definition: () => definition19,
|
|
2167
|
+
execute: () => execute19
|
|
2067
2168
|
});
|
|
2068
2169
|
import chalk10 from "chalk";
|
|
2069
|
-
import { select as
|
|
2070
|
-
var
|
|
2170
|
+
import { select as select8, input as promptInput5 } from "@inquirer/prompts";
|
|
2171
|
+
var definition19 = {
|
|
2071
2172
|
type: "function",
|
|
2072
2173
|
function: {
|
|
2073
2174
|
name: "ask_user",
|
|
@@ -2086,7 +2187,7 @@ var definition17 = {
|
|
|
2086
2187
|
}
|
|
2087
2188
|
}
|
|
2088
2189
|
};
|
|
2089
|
-
async function
|
|
2190
|
+
async function execute19(input, _config) {
|
|
2090
2191
|
const question = input["question"];
|
|
2091
2192
|
const options = input["options"];
|
|
2092
2193
|
const OTHER = "__other__";
|
|
@@ -2099,14 +2200,14 @@ async function execute17(input, _config) {
|
|
|
2099
2200
|
console.log(chalk10.dim(" \u2514" + "\u2500".repeat(67)));
|
|
2100
2201
|
let answer;
|
|
2101
2202
|
try {
|
|
2102
|
-
const chosen = await
|
|
2203
|
+
const chosen = await select8({
|
|
2103
2204
|
message: " ",
|
|
2104
2205
|
choices: [
|
|
2105
2206
|
...options.map((o) => ({ name: o, value: o })),
|
|
2106
2207
|
{ name: chalk10.dim("Other (describe below)"), value: OTHER }
|
|
2107
2208
|
]
|
|
2108
2209
|
});
|
|
2109
|
-
answer = chosen === OTHER ? await
|
|
2210
|
+
answer = chosen === OTHER ? await promptInput5({ message: "Your answer:" }) : chosen;
|
|
2110
2211
|
} catch {
|
|
2111
2212
|
answer = "User skipped this question \u2014 use your best judgement.";
|
|
2112
2213
|
}
|
|
@@ -2127,7 +2228,9 @@ var toolModules = [
|
|
|
2127
2228
|
open_code_exports,
|
|
2128
2229
|
reject_exports,
|
|
2129
2230
|
accept_exports,
|
|
2231
|
+
edit_task_exports,
|
|
2130
2232
|
// Low-level tools
|
|
2233
|
+
list_tasks_exports,
|
|
2131
2234
|
get_task_exports,
|
|
2132
2235
|
get_comments_exports,
|
|
2133
2236
|
get_diff_exports,
|
|
@@ -2168,7 +2271,7 @@ function getConfig() {
|
|
|
2168
2271
|
// src/mcp.ts
|
|
2169
2272
|
var tools = toolModules.filter((m) => m.definition.function.name !== "ask_user");
|
|
2170
2273
|
var server = new Server(
|
|
2171
|
-
{ name: "techunter", version: "
|
|
2274
|
+
{ name: "techunter", version: "1" },
|
|
2172
2275
|
{ capabilities: { tools: {} } }
|
|
2173
2276
|
);
|
|
2174
2277
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "techunter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "AI-powered task distribution CLI for development teams",
|
|
5
5
|
"author": "Techunter Contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -62,4 +62,4 @@
|
|
|
62
62
|
"tasks",
|
|
63
63
|
"developer-tools"
|
|
64
64
|
]
|
|
65
|
-
}
|
|
65
|
+
}
|