techunter 0.1.7 → 0.1.9

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 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";
@@ -622,13 +650,15 @@ async function resetOrCreateBranch(branchName, sha) {
622
650
  }
623
651
 
624
652
  // src/lib/client.ts
653
+ init_proxy();
625
654
  import OpenAI from "openai";
626
655
  var DEFAULT_BASE_URL = "https://openrouter.ai/api/v1";
627
656
  var DEFAULT_MODEL = "z-ai/glm-5";
628
657
  function createClient(config) {
629
658
  return new OpenAI({
630
659
  baseURL: config.aiBaseUrl ?? DEFAULT_BASE_URL,
631
- apiKey: config.aiApiKey
660
+ apiKey: config.aiApiKey,
661
+ httpAgent: getHttpsProxyAgent()
632
662
  });
633
663
  }
634
664
  function getModel(config) {
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "techunter",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
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",
@@ -44,6 +45,7 @@
44
45
  "openai": "^4.104.0",
45
46
  "ora": "^8.1.1",
46
47
  "simple-git": "^3.27.0",
48
+ "undici": "^7.23.0",
47
49
  "zod": "^3.24.1"
48
50
  },
49
51
  "devDependencies": {