techunter 0.1.8 → 0.1.10
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/dist/index.js +45 -25
- package/dist/mcp.js +44 -14
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -9,6 +9,26 @@ var __export = (target, all) => {
|
|
|
9
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
// src/lib/proxy.ts
|
|
13
|
+
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
14
|
+
import { ProxyAgent } from "undici";
|
|
15
|
+
function getProxyUrl() {
|
|
16
|
+
return process.env.HTTPS_PROXY ?? process.env.https_proxy ?? process.env.HTTP_PROXY ?? process.env.http_proxy ?? process.env.ALL_PROXY ?? process.env.all_proxy;
|
|
17
|
+
}
|
|
18
|
+
function getHttpsProxyAgent() {
|
|
19
|
+
const proxy = getProxyUrl();
|
|
20
|
+
return proxy ? new HttpsProxyAgent(proxy) : void 0;
|
|
21
|
+
}
|
|
22
|
+
function getUndiciProxyAgent() {
|
|
23
|
+
const proxy = getProxyUrl();
|
|
24
|
+
return proxy ? new ProxyAgent(proxy) : void 0;
|
|
25
|
+
}
|
|
26
|
+
var init_proxy = __esm({
|
|
27
|
+
"src/lib/proxy.ts"() {
|
|
28
|
+
"use strict";
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
12
32
|
// src/lib/github.ts
|
|
13
33
|
var github_exports = {};
|
|
14
34
|
__export(github_exports, {
|
|
@@ -37,14 +57,21 @@ __export(github_exports, {
|
|
|
37
57
|
rejectTask: () => rejectTask
|
|
38
58
|
});
|
|
39
59
|
import { Octokit } from "@octokit/rest";
|
|
60
|
+
import { fetch as undiciFetch } from "undici";
|
|
40
61
|
function createOctokit(token) {
|
|
62
|
+
const agent = getUndiciProxyAgent();
|
|
41
63
|
return new Octokit({
|
|
42
64
|
auth: token,
|
|
43
65
|
log: { debug: () => {
|
|
44
66
|
}, info: () => {
|
|
45
67
|
}, warn: () => {
|
|
46
68
|
}, error: () => {
|
|
47
|
-
} }
|
|
69
|
+
} },
|
|
70
|
+
...agent && {
|
|
71
|
+
request: {
|
|
72
|
+
fetch: (url, opts) => undiciFetch(url, { ...opts, dispatcher: agent })
|
|
73
|
+
}
|
|
74
|
+
}
|
|
48
75
|
});
|
|
49
76
|
}
|
|
50
77
|
function parseIssue(issue) {
|
|
@@ -352,6 +379,7 @@ var LABEL_AVAILABLE, LABEL_CLAIMED, LABEL_IN_REVIEW, LABEL_CHANGES_NEEDED, LABEL
|
|
|
352
379
|
var init_github = __esm({
|
|
353
380
|
"src/lib/github.ts"() {
|
|
354
381
|
"use strict";
|
|
382
|
+
init_proxy();
|
|
355
383
|
LABEL_AVAILABLE = "techunter:available";
|
|
356
384
|
LABEL_CLAIMED = "techunter:claimed";
|
|
357
385
|
LABEL_IN_REVIEW = "techunter:in-review";
|
|
@@ -367,15 +395,6 @@ var init_github = __esm({
|
|
|
367
395
|
}
|
|
368
396
|
});
|
|
369
397
|
|
|
370
|
-
// src/lib/proxy.ts
|
|
371
|
-
import { ProxyAgent, setGlobalDispatcher } from "undici";
|
|
372
|
-
function setupProxy() {
|
|
373
|
-
const proxy = process.env.HTTPS_PROXY ?? process.env.https_proxy ?? process.env.HTTP_PROXY ?? process.env.http_proxy ?? process.env.ALL_PROXY ?? process.env.all_proxy;
|
|
374
|
-
if (proxy) {
|
|
375
|
-
setGlobalDispatcher(new ProxyAgent(proxy));
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
398
|
// src/index.ts
|
|
380
399
|
import chalk14 from "chalk";
|
|
381
400
|
import readline from "readline";
|
|
@@ -631,13 +650,15 @@ async function resetOrCreateBranch(branchName, sha) {
|
|
|
631
650
|
}
|
|
632
651
|
|
|
633
652
|
// src/lib/client.ts
|
|
653
|
+
init_proxy();
|
|
634
654
|
import OpenAI from "openai";
|
|
635
655
|
var DEFAULT_BASE_URL = "https://openrouter.ai/api/v1";
|
|
636
656
|
var DEFAULT_MODEL = "z-ai/glm-5";
|
|
637
657
|
function createClient(config) {
|
|
638
658
|
return new OpenAI({
|
|
639
659
|
baseURL: config.aiBaseUrl ?? DEFAULT_BASE_URL,
|
|
640
|
-
apiKey: config.aiApiKey
|
|
660
|
+
apiKey: config.aiApiKey,
|
|
661
|
+
httpAgent: getHttpsProxyAgent()
|
|
641
662
|
});
|
|
642
663
|
}
|
|
643
664
|
function getModel(config) {
|
|
@@ -1616,19 +1637,19 @@ import open2 from "open";
|
|
|
1616
1637
|
// src/tools/new-task/prompts.ts
|
|
1617
1638
|
var GUIDE_FORMAT = `
|
|
1618
1639
|
## Guide format
|
|
1619
|
-
|
|
1640
|
+
Detect the language from the task title and write everything \u2014 including section headings \u2014 in that same language. Use plain markdown, no code blocks. Be concise. Include exactly these four sections (translate the heading names accordingly):
|
|
1620
1641
|
|
|
1621
|
-
###
|
|
1622
|
-
Describe what needs to be done and why. Cover the background, the problem being solved, and the expected outcome.
|
|
1642
|
+
### Task Description
|
|
1643
|
+
Describe what needs to be done and why. Cover the background, the problem being solved, and the expected outcome.
|
|
1623
1644
|
|
|
1624
|
-
###
|
|
1645
|
+
### Files Involved
|
|
1625
1646
|
List each file path with CREATE/MODIFY, and one sentence describing what changes.
|
|
1626
1647
|
|
|
1627
|
-
###
|
|
1648
|
+
### Input / Output
|
|
1628
1649
|
What the feature/fix receives as input and what it produces or affects.
|
|
1629
1650
|
|
|
1630
|
-
###
|
|
1631
|
-
Checkbox list of only the most essential testable conditions. Maximum 3 items
|
|
1651
|
+
### Acceptance Criteria
|
|
1652
|
+
Checkbox list of only the most essential testable conditions. Maximum 3 items.
|
|
1632
1653
|
`.trim();
|
|
1633
1654
|
|
|
1634
1655
|
// src/tools/new-task/guide-generator.ts
|
|
@@ -1994,18 +2015,18 @@ import ora8 from "ora";
|
|
|
1994
2015
|
|
|
1995
2016
|
// src/tools/reject/prompts.ts
|
|
1996
2017
|
var REJECTION_FORMAT = `
|
|
1997
|
-
|
|
2018
|
+
Detect the language from the reviewer feedback and write everything \u2014 including section headings \u2014 in that same language. Use markdown. Include exactly these four sections (translate the heading names accordingly):
|
|
1998
2019
|
|
|
1999
|
-
### \u274C
|
|
2020
|
+
### \u274C Rejection Reason
|
|
2000
2021
|
One paragraph: what was reviewed and what the main problem is.
|
|
2001
2022
|
|
|
2002
|
-
### \u{1F527}
|
|
2023
|
+
### \u{1F527} Required Changes
|
|
2003
2024
|
Numbered, specific, actionable items. Reference file names and function names.
|
|
2004
2025
|
|
|
2005
|
-
### \u2705
|
|
2026
|
+
### \u2705 Failed Acceptance Criteria
|
|
2006
2027
|
Re-list each criterion that was NOT met, prefixed with \u274C.
|
|
2007
2028
|
|
|
2008
|
-
### \u{1F4CB}
|
|
2029
|
+
### \u{1F4CB} Next Steps
|
|
2009
2030
|
Clear instruction on what to fix and how to re-submit (via /submit).
|
|
2010
2031
|
`.trim();
|
|
2011
2032
|
|
|
@@ -2999,7 +3020,6 @@ async function runAgentLoop(config, messages) {
|
|
|
2999
3020
|
}
|
|
3000
3021
|
|
|
3001
3022
|
// src/index.ts
|
|
3002
|
-
setupProxy();
|
|
3003
3023
|
var _require = createRequire(import.meta.url);
|
|
3004
3024
|
var { version } = _require("../package.json");
|
|
3005
3025
|
var SLASH_NAMES = [
|
|
@@ -3080,7 +3100,7 @@ function printBanner(config) {
|
|
|
3080
3100
|
console.log(" " + g("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"));
|
|
3081
3101
|
console.log("");
|
|
3082
3102
|
console.log(
|
|
3083
|
-
" " + chalk14.bold("Techunter") + chalk14.dim(` v${version}`) + chalk14.dim(" \xB7 ") + chalk14.cyan(
|
|
3103
|
+
" " + chalk14.bold("Techunter") + chalk14.dim(` v${version}`) + chalk14.dim(" \xB7 ") + chalk14.cyan(getModel(config)) + chalk14.dim(" \xB7 ") + chalk14.dim(`${owner}/${repo}`)
|
|
3084
3104
|
);
|
|
3085
3105
|
console.log("");
|
|
3086
3106
|
}
|
package/dist/mcp.js
CHANGED
|
@@ -9,6 +9,26 @@ var __export = (target, all) => {
|
|
|
9
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
// src/lib/proxy.ts
|
|
13
|
+
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
14
|
+
import { ProxyAgent } from "undici";
|
|
15
|
+
function getProxyUrl() {
|
|
16
|
+
return process.env.HTTPS_PROXY ?? process.env.https_proxy ?? process.env.HTTP_PROXY ?? process.env.http_proxy ?? process.env.ALL_PROXY ?? process.env.all_proxy;
|
|
17
|
+
}
|
|
18
|
+
function getHttpsProxyAgent() {
|
|
19
|
+
const proxy = getProxyUrl();
|
|
20
|
+
return proxy ? new HttpsProxyAgent(proxy) : void 0;
|
|
21
|
+
}
|
|
22
|
+
function getUndiciProxyAgent() {
|
|
23
|
+
const proxy = getProxyUrl();
|
|
24
|
+
return proxy ? new ProxyAgent(proxy) : void 0;
|
|
25
|
+
}
|
|
26
|
+
var init_proxy = __esm({
|
|
27
|
+
"src/lib/proxy.ts"() {
|
|
28
|
+
"use strict";
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
12
32
|
// src/lib/github.ts
|
|
13
33
|
var github_exports = {};
|
|
14
34
|
__export(github_exports, {
|
|
@@ -37,14 +57,21 @@ __export(github_exports, {
|
|
|
37
57
|
rejectTask: () => rejectTask
|
|
38
58
|
});
|
|
39
59
|
import { Octokit } from "@octokit/rest";
|
|
60
|
+
import { fetch as undiciFetch } from "undici";
|
|
40
61
|
function createOctokit(token) {
|
|
62
|
+
const agent = getUndiciProxyAgent();
|
|
41
63
|
return new Octokit({
|
|
42
64
|
auth: token,
|
|
43
65
|
log: { debug: () => {
|
|
44
66
|
}, info: () => {
|
|
45
67
|
}, warn: () => {
|
|
46
68
|
}, error: () => {
|
|
47
|
-
} }
|
|
69
|
+
} },
|
|
70
|
+
...agent && {
|
|
71
|
+
request: {
|
|
72
|
+
fetch: (url, opts) => undiciFetch(url, { ...opts, dispatcher: agent })
|
|
73
|
+
}
|
|
74
|
+
}
|
|
48
75
|
});
|
|
49
76
|
}
|
|
50
77
|
function parseIssue(issue) {
|
|
@@ -352,6 +379,7 @@ var LABEL_AVAILABLE, LABEL_CLAIMED, LABEL_IN_REVIEW, LABEL_CHANGES_NEEDED, LABEL
|
|
|
352
379
|
var init_github = __esm({
|
|
353
380
|
"src/lib/github.ts"() {
|
|
354
381
|
"use strict";
|
|
382
|
+
init_proxy();
|
|
355
383
|
LABEL_AVAILABLE = "techunter:available";
|
|
356
384
|
LABEL_CLAIMED = "techunter:claimed";
|
|
357
385
|
LABEL_IN_REVIEW = "techunter:in-review";
|
|
@@ -725,13 +753,15 @@ import ora from "ora";
|
|
|
725
753
|
import { select, input as promptInput } from "@inquirer/prompts";
|
|
726
754
|
|
|
727
755
|
// src/lib/client.ts
|
|
756
|
+
init_proxy();
|
|
728
757
|
import OpenAI from "openai";
|
|
729
758
|
var DEFAULT_BASE_URL = "https://openrouter.ai/api/v1";
|
|
730
759
|
var DEFAULT_MODEL = "z-ai/glm-5";
|
|
731
760
|
function createClient(config) {
|
|
732
761
|
return new OpenAI({
|
|
733
762
|
baseURL: config.aiBaseUrl ?? DEFAULT_BASE_URL,
|
|
734
|
-
apiKey: config.aiApiKey
|
|
763
|
+
apiKey: config.aiApiKey,
|
|
764
|
+
httpAgent: getHttpsProxyAgent()
|
|
735
765
|
});
|
|
736
766
|
}
|
|
737
767
|
function getModel(config) {
|
|
@@ -1311,19 +1341,19 @@ import open from "open";
|
|
|
1311
1341
|
// src/tools/new-task/prompts.ts
|
|
1312
1342
|
var GUIDE_FORMAT = `
|
|
1313
1343
|
## Guide format
|
|
1314
|
-
|
|
1344
|
+
Detect the language from the task title and write everything \u2014 including section headings \u2014 in that same language. Use plain markdown, no code blocks. Be concise. Include exactly these four sections (translate the heading names accordingly):
|
|
1315
1345
|
|
|
1316
|
-
###
|
|
1317
|
-
Describe what needs to be done and why. Cover the background, the problem being solved, and the expected outcome.
|
|
1346
|
+
### Task Description
|
|
1347
|
+
Describe what needs to be done and why. Cover the background, the problem being solved, and the expected outcome.
|
|
1318
1348
|
|
|
1319
|
-
###
|
|
1349
|
+
### Files Involved
|
|
1320
1350
|
List each file path with CREATE/MODIFY, and one sentence describing what changes.
|
|
1321
1351
|
|
|
1322
|
-
###
|
|
1352
|
+
### Input / Output
|
|
1323
1353
|
What the feature/fix receives as input and what it produces or affects.
|
|
1324
1354
|
|
|
1325
|
-
###
|
|
1326
|
-
Checkbox list of only the most essential testable conditions. Maximum 3 items
|
|
1355
|
+
### Acceptance Criteria
|
|
1356
|
+
Checkbox list of only the most essential testable conditions. Maximum 3 items.
|
|
1327
1357
|
`.trim();
|
|
1328
1358
|
|
|
1329
1359
|
// src/tools/new-task/guide-generator.ts
|
|
@@ -1689,18 +1719,18 @@ import ora7 from "ora";
|
|
|
1689
1719
|
|
|
1690
1720
|
// src/tools/reject/prompts.ts
|
|
1691
1721
|
var REJECTION_FORMAT = `
|
|
1692
|
-
|
|
1722
|
+
Detect the language from the reviewer feedback and write everything \u2014 including section headings \u2014 in that same language. Use markdown. Include exactly these four sections (translate the heading names accordingly):
|
|
1693
1723
|
|
|
1694
|
-
### \u274C
|
|
1724
|
+
### \u274C Rejection Reason
|
|
1695
1725
|
One paragraph: what was reviewed and what the main problem is.
|
|
1696
1726
|
|
|
1697
|
-
### \u{1F527}
|
|
1727
|
+
### \u{1F527} Required Changes
|
|
1698
1728
|
Numbered, specific, actionable items. Reference file names and function names.
|
|
1699
1729
|
|
|
1700
|
-
### \u2705
|
|
1730
|
+
### \u2705 Failed Acceptance Criteria
|
|
1701
1731
|
Re-list each criterion that was NOT met, prefixed with \u274C.
|
|
1702
1732
|
|
|
1703
|
-
### \u{1F4CB}
|
|
1733
|
+
### \u{1F4CB} Next Steps
|
|
1704
1734
|
Clear instruction on what to fix and how to re-submit (via /submit).
|
|
1705
1735
|
`.trim();
|
|
1706
1736
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "techunter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "AI-powered task distribution CLI for development teams",
|
|
5
5
|
"author": "Techunter Contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"commander": "^12.1.0",
|
|
37
37
|
"conf": "^13.0.1",
|
|
38
38
|
"globby": "^14.0.2",
|
|
39
|
+
"https-proxy-agent": "^8.0.0",
|
|
39
40
|
"ignore": "^6.0.2",
|
|
40
41
|
"inquirer": "^12.3.2",
|
|
41
42
|
"marked": "^15.0.12",
|