thincoder 0.8.7 → 0.8.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/package.json +1 -1
- package/src/tools/system.mjs +4 -16
- package/src/tui/wizard.mjs +1 -1
package/package.json
CHANGED
package/src/tools/system.mjs
CHANGED
|
@@ -17,16 +17,6 @@ import { spawn, execFileSync } from "node:child_process";
|
|
|
17
17
|
import { readFile, readdir, stat, lstat } from "node:fs/promises";
|
|
18
18
|
import { join } from "node:path";
|
|
19
19
|
|
|
20
|
-
/** Child process environment variable whitelist: only pass through safe variables, isolate sensitive info like API keys */
|
|
21
|
-
const SAFE_ENV_KEYS = new Set([
|
|
22
|
-
"PATH", "HOME", "USERPROFILE", "APPDATA", "LOCALAPPDATA",
|
|
23
|
-
"TEMP", "TMP", "TMPDIR", "LANG", "LC_ALL", "LC_CTYPE", "SHELL",
|
|
24
|
-
"ComSpec", "PATHEXT", "SystemRoot", "windir",
|
|
25
|
-
"NUMBER_OF_PROCESSORS", "PROCESSOR_ARCHITECTURE", "OS",
|
|
26
|
-
"PYTHONIOENCODING", "GIT_EDITOR", "EDITOR", "VISUAL",
|
|
27
|
-
"GIT_PAGER", "PAGER", "TERM",
|
|
28
|
-
])
|
|
29
|
-
|
|
30
20
|
/** Maximum buffer size per stream (stdout / stderr) before truncation */
|
|
31
21
|
const MAX_STREAM_BUF = 2_000_000
|
|
32
22
|
|
|
@@ -67,16 +57,14 @@ function checkBashSafety(command, cwd) {
|
|
|
67
57
|
}
|
|
68
58
|
|
|
69
59
|
/**
|
|
70
|
-
* Build
|
|
71
|
-
*
|
|
72
|
-
*
|
|
60
|
+
* Build environment for child process.
|
|
61
|
+
* Passes through all parent env vars, with non-interactive overrides (EDITOR/PAGER/TERM).
|
|
62
|
+
* Sets PYTHONIOENCODING on Windows to override GBK default for Python scripts.
|
|
73
63
|
*/
|
|
74
64
|
function buildBashEnv() {
|
|
75
65
|
const winCmd = process.platform === "win32"
|
|
76
66
|
return {
|
|
77
|
-
...
|
|
78
|
-
Object.entries(process.env).filter(([k]) => SAFE_ENV_KEYS.has(k))
|
|
79
|
-
),
|
|
67
|
+
...process.env,
|
|
80
68
|
GIT_EDITOR: "true",
|
|
81
69
|
EDITOR: "true",
|
|
82
70
|
VISUAL: "true",
|
package/src/tui/wizard.mjs
CHANGED
|
@@ -164,5 +164,5 @@ export function createWizard(ctx) {
|
|
|
164
164
|
ctx.openModelPicker().catch((e) => pushLine(`[error] ${e.message}`, C.error))
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
return { startWizard, renderWizard, wizardChooseProvider, wizardSubmitText, cancelWizard, finishWizard }
|
|
167
|
+
return { startWizard, renderWizard, wizardChooseProvider, wizardSubmitText, cancelWizard, finishWizard, wizardProviderItems }
|
|
168
168
|
}
|