@celljs/ta-harness 4.14.0 → 4.15.0
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/esm/node/bug-report.js +20 -2
- package/lib/node/bug-report.js +20 -2
- package/package.json +4 -4
package/esm/node/bug-report.js
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves a language tag to one of the four supported languages.
|
|
4
|
+
* Rules: zh with -tw/-hk/-mo/-hant suffix → zh-TW; other zh → zh-CN; ja → ja-JP; others → en-US.
|
|
5
|
+
*/
|
|
6
|
+
function ofLanguage(tag) {
|
|
7
|
+
if (/^zh/i.test(tag)) {
|
|
8
|
+
return /(?:tw|hk|mo|hant)/i.test(tag) ? 'zh-TW' : 'zh-CN';
|
|
9
|
+
}
|
|
10
|
+
if (/^ja/i.test(tag)) {
|
|
11
|
+
return 'ja-JP';
|
|
12
|
+
}
|
|
13
|
+
return 'en-US';
|
|
14
|
+
}
|
|
2
15
|
export var BugReport;
|
|
3
16
|
(function (BugReport) {
|
|
4
17
|
BugReport.ISSUES_URL = 'https://github.com/cellbang/ta/issues/new';
|
|
@@ -36,9 +49,14 @@ export var BugReport;
|
|
|
36
49
|
BugReport.open = open;
|
|
37
50
|
/** What `/bug` says, in the language of Ta's pages (`TA_LANGUAGE`) or the computer's. */
|
|
38
51
|
function notice(url, env = process.env) {
|
|
39
|
-
|
|
52
|
+
const language = ofLanguage(env.TA_LANGUAGE || env.LC_ALL || env.LANG || '');
|
|
53
|
+
return language === 'zh-CN'
|
|
40
54
|
? `一个新的 Ta 问题(只带版本、模型和平台信息)会在浏览器里打开。如果没有打开:\n${url}`
|
|
41
|
-
:
|
|
55
|
+
: language === 'zh-TW'
|
|
56
|
+
? `一個新的 Ta 問題(只帶版本、模型和平台資訊)會在瀏覽器裡開啟。如果沒有開啟:\n${url}`
|
|
57
|
+
: language === 'ja-JP'
|
|
58
|
+
? `Ta の新しい問題(バージョン、モデル、プラットフォーム情報のみ)がブラウザで開きます。開かない場合:\n${url}`
|
|
59
|
+
: `A new issue for Ta, with its version, the model and the platform and nothing else, opens in the browser. If it did not:\n${url}`;
|
|
42
60
|
}
|
|
43
61
|
BugReport.notice = notice;
|
|
44
62
|
})(BugReport || (BugReport = {}));
|
package/lib/node/bug-report.js
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BugReport = void 0;
|
|
4
4
|
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
/**
|
|
6
|
+
* Resolves a language tag to one of the four supported languages.
|
|
7
|
+
* Rules: zh with -tw/-hk/-mo/-hant suffix → zh-TW; other zh → zh-CN; ja → ja-JP; others → en-US.
|
|
8
|
+
*/
|
|
9
|
+
function ofLanguage(tag) {
|
|
10
|
+
if (/^zh/i.test(tag)) {
|
|
11
|
+
return /(?:tw|hk|mo|hant)/i.test(tag) ? 'zh-TW' : 'zh-CN';
|
|
12
|
+
}
|
|
13
|
+
if (/^ja/i.test(tag)) {
|
|
14
|
+
return 'ja-JP';
|
|
15
|
+
}
|
|
16
|
+
return 'en-US';
|
|
17
|
+
}
|
|
5
18
|
var BugReport;
|
|
6
19
|
(function (BugReport) {
|
|
7
20
|
BugReport.ISSUES_URL = 'https://github.com/cellbang/ta/issues/new';
|
|
@@ -39,9 +52,14 @@ var BugReport;
|
|
|
39
52
|
BugReport.open = open;
|
|
40
53
|
/** What `/bug` says, in the language of Ta's pages (`TA_LANGUAGE`) or the computer's. */
|
|
41
54
|
function notice(url, env = process.env) {
|
|
42
|
-
|
|
55
|
+
const language = ofLanguage(env.TA_LANGUAGE || env.LC_ALL || env.LANG || '');
|
|
56
|
+
return language === 'zh-CN'
|
|
43
57
|
? `一个新的 Ta 问题(只带版本、模型和平台信息)会在浏览器里打开。如果没有打开:\n${url}`
|
|
44
|
-
:
|
|
58
|
+
: language === 'zh-TW'
|
|
59
|
+
? `一個新的 Ta 問題(只帶版本、模型和平台資訊)會在瀏覽器裡開啟。如果沒有開啟:\n${url}`
|
|
60
|
+
: language === 'ja-JP'
|
|
61
|
+
? `Ta の新しい問題(バージョン、モデル、プラットフォーム情報のみ)がブラウザで開きます。開かない場合:\n${url}`
|
|
62
|
+
: `A new issue for Ta, with its version, the model and the platform and nothing else, opens in the browser. If it did not:\n${url}`;
|
|
45
63
|
}
|
|
46
64
|
BugReport.notice = notice;
|
|
47
65
|
})(BugReport || (exports.BugReport = BugReport = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-harness",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.0",
|
|
4
4
|
"description": "The agent runtime of Ta on pi: branding, session locks and execution environment adapters",
|
|
5
5
|
"homepage": "https://github.com/cellbang/ta",
|
|
6
6
|
"bugs": {
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@celljs/ai-coding-agent": "4.
|
|
33
|
-
"@celljs/ta-exec": "4.
|
|
34
|
-
"@celljs/ta-relay": "4.
|
|
32
|
+
"@celljs/ai-coding-agent": "4.15.0",
|
|
33
|
+
"@celljs/ta-exec": "4.15.0",
|
|
34
|
+
"@celljs/ta-relay": "4.15.0",
|
|
35
35
|
"@earendil-works/pi-coding-agent": "^1.5.2",
|
|
36
36
|
"@earendil-works/pi-mcp": "^1.5.2"
|
|
37
37
|
},
|