techunter 0.1.8 → 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";
@@ -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) {
@@ -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 = [
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.8",
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",