fix: resolve build errors in pass_mgr, pcexec, and safe-restart

- Fix Go syntax error: use BoolVar for --username flag instead of string
- Fix TypeScript type errors: filter undefined values from process.env
- Fix TypeScript type error: add type assertion for fetch response
- Add .gitignore to exclude node_modules and build outputs
This commit is contained in:
zhi
2026-03-05 10:00:30 +00:00
parent 849effd301
commit 28af11cfbb
9 changed files with 8811 additions and 15 deletions

3846
pcexec/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -164,10 +164,19 @@ async function replacePassMgrGets(command: string): Promise<{ command: string; p
*/
export async function pcexec(command: string, options: PcExecOptions = {}): Promise<PcExecResult> {
// Set up environment with workspace/agent info
const env: Record<string, string> = {
...process.env,
...options.env,
};
const env: Record<string, string> = {};
// Copy process.env, filtering out undefined values
for (const [key, value] of Object.entries(process.env)) {
if (value !== undefined) {
env[key] = value;
}
}
// Merge options.env
if (options.env) {
Object.assign(env, options.env);
}
if (process.env.AGENT_WORKSPACE) {
env.AGENT_WORKSPACE = process.env.AGENT_WORKSPACE;
@@ -284,10 +293,19 @@ export function pcexecSync(command: string, options: PcExecOptions = {}): PcExec
const { execSync } = require('child_process');
// Set up environment
const env: Record<string, string> = {
...process.env,
...options.env,
};
const env: Record<string, string> = {};
// Copy process.env, filtering out undefined values
for (const [key, value] of Object.entries(process.env)) {
if (value !== undefined) {
env[key] = value;
}
}
// Merge options.env
if (options.env) {
Object.assign(env, options.env);
}
if (process.env.AGENT_WORKSPACE) {
env.AGENT_WORKSPACE = process.env.AGENT_WORKSPACE;