@bash0816/copilot-termux 1.0.72 → 1.0.73

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.
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "manifest_version": 1,
3
3
  "package_name": "@bash0816/copilot-termux",
4
- "copilot_version": "1.0.72",
5
- "latest_audited_version": "1.0.71",
4
+ "copilot_version": "1.0.73",
5
+ "latest_audited_version": "1.0.72",
6
6
  "latest_candidate_version": null,
7
- "previous_stable_version": "1.0.70",
7
+ "previous_stable_version": "1.0.71",
8
8
  "candidate_state": "none",
9
9
  "canonical_package_status": "not_published",
10
10
  "public_distribution_status": "staged",
11
11
  "nodejs_glibc_version": "node-glibc-v24.15.0",
12
12
  "build_run_id": null,
13
- "last_updated": "2026-07-20",
13
+ "last_updated": "2026-07-21",
14
14
  "manifest_url": "https://raw.githubusercontent.com/bash0816/Github-Copilot-Termux/main/packages/copilot-termux/config/copilot-termux-release-manifest.json"
15
15
  }
@@ -2,8 +2,8 @@
2
2
  "wrapperVersion": "2.0.0",
3
3
  "copilot": {
4
4
  "package": "@github/copilot-linuxmusl-arm64",
5
- "version": "1.0.72",
6
- "integrity": "sha512-9gQQkln+qmsmq80eYua9pbaxGOajKVRlYBB+0xYWM+yEUebZB52u/IbUGhWJImvbax8EWqGoTU6ngswrs/nYJA=="
5
+ "version": "1.0.73",
6
+ "integrity": "sha512-HJWzhfD3oaiIgfRAHkNWzp17fELtshqM9HVN5n+lFEmSO2EETCEh0P1lhJc4m+FYfXSJnL0raAqVuyaNMuPoPw=="
7
7
  },
8
8
  "glibcNode": {
9
9
  "version": "26.2.0",
@@ -46,6 +46,83 @@ async function hashFileContent(gitRoot, filePath) {
46
46
  }
47
47
  }
48
48
 
49
+ // GIT-ASYNC-002: bionicフォールバック限定のSIGSEGV(gitLegacyRemotesAsync/gitWorkingDirectoryContextAsync/
50
+ // gitRepoIdentifierAtPathAsync、いずれもRust tokio非同期)をJSスタブで置換するための共通ヘルパー。
51
+ // git CLI(`git remote -v`)の出力をパースしてリモート一覧を取得する。shell経由なし(execFileAsync配列引数)。
52
+ async function listGitRemotes(gitRoot) {
53
+ const out = await runGit(gitRoot, ['remote', '-v']);
54
+ if (!out) return [];
55
+ const seen = new Set();
56
+ const remotes = [];
57
+ for (const line of out.split('\n')) {
58
+ const m = /^(\S+)\s+(\S+)\s+\(fetch\)$/.exec(line);
59
+ if (!m) continue;
60
+ const [, name, url] = m;
61
+ if (seen.has(name)) continue;
62
+ seen.add(name);
63
+ remotes.push({ Name: name, FetchURL: url });
64
+ }
65
+ return remotes;
66
+ }
67
+
68
+ // git remote URLをowner/name/hostへパースする。https/ssh/scp-like形式に対応。
69
+ // パース不能な場合はnullを返す(呼び出し側はrepository情報なしとして扱う)。
70
+ function parseGitRemoteUrl(url) {
71
+ if (!url) return null;
72
+ if (!/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(url)) {
73
+ // scp-like: [user@]host:path (例: git@github.com:owner/repo.git)
74
+ const m = /^(?:[^@/]+@)?([^:/]+):(.+)$/.exec(url);
75
+ if (!m) return null;
76
+ const host = m[1];
77
+ const parts = m[2].replace(/\.git$/, '').split('/').filter(Boolean);
78
+ if (parts.length < 2) return null;
79
+ return { host, owner: parts[parts.length - 2], name: parts[parts.length - 1] };
80
+ }
81
+ try {
82
+ const u = new URL(url);
83
+ const parts = u.pathname.replace(/\.git$/, '').split('/').filter(Boolean);
84
+ if (parts.length < 2) return null;
85
+ return { host: u.hostname, owner: parts[parts.length - 2], name: parts[parts.length - 1] };
86
+ } catch (_) {
87
+ return null;
88
+ }
89
+ }
90
+
91
+ // origin(なければ先頭のリモート)からリポジトリ識別子を解決する。
92
+ // vendor実装(app.jsの`tge()`/`tmr()`相当)に合わせ、GitHub Cloud(github.com/*.ghe.com)以外は
93
+ // hostTypeを'other'とする(自己ホストGHE Serverの判定手がかりがないのは実装側と同じ制約)。
94
+ async function resolveRepoIdentifier(gitRoot) {
95
+ const remotes = await listGitRemotes(gitRoot);
96
+ if (!remotes.length) return null;
97
+ const origin = remotes.find((r) => r.Name === 'origin') || remotes[0];
98
+ const parsed = parseGitRemoteUrl(origin.FetchURL);
99
+ if (!parsed) return null;
100
+ const hostType = (parsed.host === 'github.com' || parsed.host.endsWith('.ghe.com')) ? 'github' : 'other';
101
+ return { identifier: `${parsed.owner}/${parsed.name}`, hostType, host: parsed.host };
102
+ }
103
+
104
+ // working directory context: cwdからgitRoot/branch/repository情報を解決する。
105
+ // vendor実装(gitWorkingDirectoryContextAsync)と同じく、非git配下ではcwdのみを持つ
106
+ // オブジェクトを返す(nullは返さない。nullを返すと呼び出し側で`.gitRoot`アクセス時に
107
+ // TypeErrorが発生し無応答exit 0になることを実機で確認済み)。
108
+ async function buildWorkingDirectoryContext(cwd) {
109
+ const result = { cwd };
110
+ const rootOut = await runGit(cwd, ['rev-parse', '--show-toplevel']);
111
+ const gitRoot = rootOut ? rootOut.trim() : null;
112
+ if (!gitRoot) return result;
113
+ result.gitRoot = gitRoot;
114
+ const branchOut = await runGit(gitRoot, ['branch', '--show-current']);
115
+ const branch = branchOut ? branchOut.trim() : '';
116
+ if (branch) result.branch = branch;
117
+ const identifier = await resolveRepoIdentifier(gitRoot);
118
+ if (identifier) {
119
+ result.repository = identifier.identifier;
120
+ result.hostType = identifier.hostType;
121
+ result.repositoryHost = identifier.host;
122
+ }
123
+ return result;
124
+ }
125
+
49
126
  const _pkgVersion = (() => {
50
127
  try { return require(path.join(__dirname, '..', 'package.json')).version; } catch (_) { return '1.0.65'; }
51
128
  })();
@@ -127,6 +204,8 @@ Module._load = function (request, parent, isMain) {
127
204
  const BIONIC_SIGSEGV_STUBS = [
128
205
  'capiClientRetrieveAvailableModels',
129
206
  'mcpClientConnectStreamableHttpWithHandlersAndOnclose',
207
+ 'mcpNativeHostConnect', // MCP-BIONIC-002: bionic上でMCPサーバー接続処理が
208
+ // tokioワーカースレッド内でSIGSEGVするため、既存パターンと同型でクリーンなthrowに変換する
130
209
  ];
131
210
  for (const _key of BIONIC_SIGSEGV_STUBS) {
132
211
  if (typeof result[_key] === 'function') {
@@ -135,6 +214,14 @@ Module._load = function (request, parent, isMain) {
135
214
  };
136
215
  }
137
216
  }
217
+ const _missingBionicStubs = BIONIC_SIGSEGV_STUBS.filter(_key => typeof result[_key] !== 'function');
218
+ if (_missingBionicStubs.length > 0) {
219
+ throw new Error(
220
+ `[copilot-termux] BIONIC_SIGSEGV_STUBS target(s) not found in runtime.node: ${_missingBionicStubs.join(', ')}. ` +
221
+ 'This likely means upstream renamed/removed a NAPI export that this SIGSEGV guard depends on. ' +
222
+ 'Re-audit before releasing for bionic.'
223
+ );
224
+ }
138
225
  // git*Async: Rust tokio async functions — type-safe stubs to prevent SIGSEGV.
139
226
  // Returns empty/null values matching what app.js callers expect.
140
227
  const GIT_ASYNC_STUBS = {
@@ -209,6 +296,9 @@ Module._load = function (request, parent, isMain) {
209
296
  if (!out) return [];
210
297
  return out.split('\n').filter(Boolean);
211
298
  },
299
+ gitLegacyRemotesAsync: async (gitRoot) => listGitRemotes(gitRoot),
300
+ gitRepoIdentifierAtPathAsync: async (gitRoot) => resolveRepoIdentifier(gitRoot),
301
+ gitWorkingDirectoryContextAsync: async (cwd) => buildWorkingDirectoryContext(cwd),
212
302
  };
213
303
  for (const [key, stub] of Object.entries(GIT_ASYNC_STUBS)) {
214
304
  if (typeof result[key] === 'function') result[key] = stub;
@@ -1532,3 +1622,7 @@ if (!globalThis.__COPILOT_TERMUX_ESM_PATCH_REGISTERED__) {
1532
1622
 
1533
1623
  module.exports.patchAppJsSource = patchAppJsSource;
1534
1624
  module.exports.isTargetCopilotAppJsUrl = isTargetCopilotAppJsUrl;
1625
+ module.exports.listGitRemotes = listGitRemotes;
1626
+ module.exports.parseGitRemoteUrl = parseGitRemoteUrl;
1627
+ module.exports.resolveRepoIdentifier = resolveRepoIdentifier;
1628
+ module.exports.buildWorkingDirectoryContext = buildWorkingDirectoryContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash0816/copilot-termux",
3
- "version": "1.0.72",
3
+ "version": "1.0.73",
4
4
  "description": "GitHub Copilot CLI for Termux (Android aarch64)",
5
5
  "license": "GPL-3.0-only",
6
6
  "readme": "README.md",