INNER CODE UNIT · TypeScript

args

open-gitagent/clawless · src/container.ts:591

    const args = config.args?.map(a => a.replace('<home>', homeDir)) ?? [];
    const spawnCmd = `node ${entry} ${args.join(' ')}`;

    this.enforcePolicy('process.spawn', spawnCmd, { activeProcesses: this.activeProcessCount });
    this.audit?.log('process.spawn', spawnCmd, undefined, { source: 'agent' });
    this.activeProcessCount++;

    const nodeOptions = [`--require ${homeDir}/network-hook.cjs`];
    if (config.overrides && Object.keys(config.overrides).length > 0) {
      nodeOptions.push(`--import ${homeDir}/stub-loader.mjs`);
    }

    this.shellProcess = await this.wc.spawn('node', [entry, ...args], {
      terminal: { cols, rows },
      env: {
        ...this.apiEnvVars,
        ...config.env,
        PATH: `${homeDir}/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin`,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…